# Re: Using multiple IF formulas in the same field

Solved
1542 0
cancel
Showing results for
Did you mean:
4 - Data Explorer

Hello!

I am a programming coordinator at a library, managing programming for 3 different branches with multiple different rooms. I’m trying to create a formula to pull from a “room” field into another that will formulate the “address” for the building the room is in. Example: Room X, Room Y, and Z should put Address 1 in the formula column, but Room A and B are at Address 2, Room C is at Address 3. I am able to use an IF formula to get it to work for 1 room, but anytime I try and add others I get errors.

Here’s what I am working with so far:

This will give me Address 1 for the “HPL Program Room” records, and address 2 for anything that is not “HPL Program Room.” If I try adding other conditions, I get errors. How do I add the other circumstances to the same string/formula field?

1 Solution

Accepted Solutions
14 - Jupiter

Since each condition you need to check is referencing the same field (`Room`), I’d suggest using a `SWITCH()` function for this:

It would look something like this:

``````SWITCH(
{Room},
)
``````

and you can continue adding your list of `"Room", "Address"` combinations inside that function. Make sure to add a comma after each address except the very last one in the list.

7 Replies 7
14 - Jupiter

Since each condition you need to check is referencing the same field (`Room`), I’d suggest using a `SWITCH()` function for this:

It would look something like this:

``````SWITCH(
{Room},
)
``````

and you can continue adding your list of `"Room", "Address"` combinations inside that function. Make sure to add a comma after each address except the very last one in the list.

13 - Mars

Hi @Annie_Tillmann - you can use a nested IF formula, although a SWITCH formula might work better in this case:

``````SWITCH(Room,
)
``````

JB

4 - Data Explorer

Thank you, this worked wonders!

5 - Automation Enthusiast

This was VERY helpful. Thank you. What would I include for “ALL OTHER VALUES” that would return a 0? Thank you @JonathanBowen

14 - Jupiter

@Niels_Schneider, you can include a “default” value as the final argument to a `SWITCH()` function. The function will fall back to the “default” value if no match is made in the `SWITCH()` function. So an example would look like this:

``````SWITCH(
{Room},