Can I use an ifs statement to create the following query? If a1=x or y or z do this, if a1= a or b or c do that

Joined
Jul 6, 2021
Messages
8
Office Version
  1. 365
Platform
  1. Windows
Hi,

So my question is if a1 = x or y or z then take the value from c1, if a1 = a or b or c take the value from c2

I know I can do something similar to this way:

IFS( A1="x",C1, A1="a",C2)

However, as I add more and more options it becomes a long string

IFS( A1="x",C1, A1="y",C1,A1="z",C1,A1="a",C2,A1="b",C2,A1="c",C2)

I want to be able to say x,y or z = C1, a,b, or c = C2 and be able to just add d,e,f,g,h,i,j,k etc

Is that possible?
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
How about
Excel Formula:
=if(or(a1={"x","y","z"}),c1,c2)
 
Upvote 0
Solution
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,148
Messages
6,123,301
Members
449,095
Latest member
Chestertim

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top