# IF FUNCTION

#### mmwater

##### New Member
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 show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
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

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)

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 \$.

Thanks for your suggestions - I will give them a try to see what works
Regards
Wendy

Replies
5
Views
149
Replies
4
Views
231
Replies
15
Views
336
Replies
20
Views
1K
Replies
13
Views
778

1,218,752
Messages
6,144,285
Members
450,535
Latest member
Erlull

### 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.

### Which adblocker are you using?

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

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