IF FUNCTION

mmwater

New Member
Joined
Sep 25, 2005
Messages
14
Hi,

Is there a way to use ' IF ' function to make a formula with three (or more) possible outcomes ? e.g. -

IF cell A1 = E B1 = $19 or
IF cell A1 = F B1 = $22 or
IF cell A1 = G B1 = $25

Or is there another function in excel where I can achieve something like the above ?

Thanks,
Wendy
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Hi Wendy

One solution:

In B1:

=IF(A1="E",19, IF(A1 = "F", 22,IF(A1 = "G",25,"A1 not valid")))

If you have many options you can also use Vlookup.

Hope this helps
PGC
 
Upvote 0
Hi,

Is there a way to use ' IF ' function to make a formula with three (or more) possible outcomes ? e.g. -

IF cell A1 = E B1 = $19 or
IF cell A1 = F B1 = $22 or
IF cell A1 = G B1 = $25

Or is there another function in excel where I can achieve something like the above ?

Thanks,
Wendy

Create a 2-column table on a different sheet named, say, Admin, which associates letters with figures. Name the table AMOUNTS. Then invoke:

=VLOOKUP(A1,AMOUNTS,2,0)

If the table of associations is fixed and short, invoke:

=VLOOKUP(A1,{"E",19;"F",22;"G",25},2,0)
 
Upvote 0
Wendy

This also might work, but I'm sure it's probably inefficient and wrong.:)

="$"&19+(CODE(A1)-CODE("E"))*3

By the way it will return a text value rather than a number.

Oh, and it does include the $.:)
 
Upvote 0

Forum statistics

Threads
1,215,693
Messages
6,126,237
Members
449,304
Latest member
hagia_sofia

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