IF Problem

aivoryuk

Board Regular
Joined
Nov 18, 2009
Messages
130
Hi

I have the following problem
=IF(ISBLANK(F11),0,LOOKUP(F11,{"H","M","L"},{1000,500,0}))

The problem I have that when if the cell (f11) has a L is returns 1000 instead of 0. it works fine if the value is H or M.

Where is it going wrong?
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Hi. Try (alphabetical order)

=IF(ISBLANK(F11),0,LOOKUP(F11,{"H","L","M"},{1000,0,500}))
 
Upvote 0
Lookup expects the values in the first {} to be sorted ascending (=alphabetical for text).
 
Upvote 0
Hi

I have the following problem
=IF(ISBLANK(F11),0,LOOKUP(F11,{"H","M","L"},{1000,500,0}))

The problem I have that when if the cell (f11) has a L is returns 1000 instead of 0. it works fine if the value is H or M.

Where is it going wrong?
The lookup_array *must* be sorted in ascending order.

Assuming that the only possible entries are an empty cell, H, L or M, here's another way to do it:

=IF(OR(F11={"","L"}),0,IF(F11="H",1000,500))
 
Upvote 0

Forum statistics

Threads
1,215,578
Messages
6,125,642
Members
449,245
Latest member
PatrickL

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