3 IF Statements

Ian_A85

New Member
Joined
Nov 26, 2010
Messages
21
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)

All 3 work seperately, but i need them in one cell, please help!
 

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
Joined
Mar 19, 2009
Messages
137
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
Joined
Aug 24, 2010
Messages
5,795
Office Version
  1. 365
Platform
  1. Windows
=CHOOSE(MATCH(U:U,{"Supplier1","Supplier2","Supplier3"},FALSE),100,125,150)
 

Ian_A85

New Member
Joined
Nov 26, 2010
Messages
21
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
Joined
Aug 24, 2010
Messages
5,795
Office Version
  1. 365
Platform
  1. Windows
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.
 

Forum statistics

Threads
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.
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
Top