# 3 IF Statements

#### Ian_A85

##### New Member
Hi all,

Really simple one today, I need to know how to put 3 If statements in one formula

I have to use:
=IF(U:U="Supplier1",100,0)
=IF(U:U="Supplier2",125,0)
=IF(U:U="Supplier3",150,0)

### Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".

#### dodger7

##### Board Regular
Im not sure about your U:U - how can a whole column equal a string? If you mean each cell in the column, try this:

=IF(\$U1="Supplier1",100,IF(\$U1="Supplier2",125,IF(\$U1="Supplier3",150,0)))

and copy it down

#### Ruddles

##### Well-known Member
=CHOOSE(MATCH(U:U,{"Supplier1","Supplier2","Supplier3"},FALSE),100,125,150)

#### Ian_A85

##### New Member
Thats great, the CHOOSE option is brilliant, one final thing, how easy it to add a IF none are chosen, it returns 0?

#### Ruddles

##### Well-known Member
Easy to do but the formula starts to get messy!

=IF(ISNA(MATCH(U:U,{"Supplier1","Supplier2","Supplier3"},FALSE)),0,CHOOSE(MATCH(U:U,{"Supplier1","Supplier2","Supplier3"},FALSE),100,125,150))

If you're going to start adding lots more suppliers I would recommend placing the names and values in a separate lookup table and using VLOOKUP: that would make the formula simpler and it means you don't have to change the list wherever it occurs in a formula - just once in the lookup table.

Replies
4
Views
221
Replies
3
Views
105
Replies
6
Views
495
Replies
5
Views
131
Replies
0
Views
172

1,172,070
Messages
5,878,990
Members
433,388
Latest member
nana2525

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