If Statement Question

shawn99michaels

New Member
Joined
May 16, 2007
Messages
38
hi,

I'm wondering if someone may know a solution to this

I'm writing a nested if where by I have 5 conditions, If a2 = 1 then lookup vidoes store worksheet, if a2 = 2 then vlookup grocery store worksheet, if a2 = 3 then vlookup convenienc store worksheet, if a2 = 4 then vlookup liquor store worksheet, if a2 is anything else then return zero. how do I satisfy this any anything else criteria does anyone know ?

Thanks
 

Some videos you may like

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

wigi

Well-known Member
Joined
Jul 10, 2006
Messages
7,958
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
  3. Web
Is the lookup range the same for each sheet?
 

wigi

Well-known Member
Joined
Jul 10, 2006
Messages
7,958
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
  3. Web
For instance:

=CHOOSE(A2,VLOOKUP(A1,'videos store'!C:D,2,0),VLOOKUP(A1,'grocery store'!C:D,2,0),VLOOKUP(A1,'convenience store'!C:D,2,0),VLOOKUP(A1,'liquor store'!C:D,2,0))

Change the C:D so that you do not use full columns for the lookup. Also, if needed, change the names of the sheets in the formula above.
 

Watch MrExcel Video

Forum statistics

Threads
1,122,964
Messages
5,599,069
Members
414,281
Latest member
Engjamal2021

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