Lookup 2,1

Jplace

New Member
Joined
Oct 20, 2017
Messages
4
Hi

I vaguely understand Lookup2,1 but what I don't fully understand about the below formula. Is if for example the Rows C-H have values that are not equal to 0 why does the formula return the value in Column H rather than the value in column C?

=LOOKUP(2,1/('Daily 2017'!$C$15:$IR$15<>0),TEXT(ROUND('Daily 2017'!$C$15:$IRO$15,0),"£0,#k"))

Thanks
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
It goes something like this
=LOOKUP(2,1/('Daily 2017'!$C$15:$IR$15<>0),

'Daily 2017'!$C$15:$IR$15<>0
This is an expression (a question) with a true or false answer for each cell in the range
Is C15 <> 0 ?
Is D15 <> 0 ?
Is E15 <> 0 ?
Etc..
So you get an array of Trues and falses, somethig like
=LOOKUP(2,1/{True,True,False,True,False,False},

When a math operation like +-*/ is applied to a True/False value, TRUE=1 FALSE=0
=LOOKUP(2,1/{1,1,0,1,0,0},

1/1 = 1
1/0 = #Div/0! error
=LOOKUP(2,{1,1,#Div/0!,1,#Div/0!,#Div/0!},

Fortunately, lookup ignores error values
So the 2 is larger than all numeric values in the array, so it uses the last number of the array (the 3rd 1 in the array)

Hope that helps.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,895
Messages
6,175,257
Members
452,625
Latest member
saadat28

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