Index and lookup

jimblimm

Board Regular
Joined
May 11, 2012
Messages
219
My setup


(day)
a1:a10 b1:b10 c1:c10 d1:d10 e1:e10
1 0 1 2 3
2 1 0 2 0
3 2 3 5 4
4 0 0 2 3
5 0 1 2 3
6 5 8 9 6
7 7 5 3 4
8 0 1 2 3
9 0 0 2 0
10 1 2 3 4

i need a formula to lookup the last time the value "0" was seen out of all 4 ranges

answer in f1=9(in reference to a1:a10(days)
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
My setup


(day)
a1:a10 b1:b10 c1:c10 d1:d10 e1:e10
1 0 1 2 3
2 1 0 2 0
3 2 3 5 4
4 0 0 2 3
5 0 1 2 3
6 5 8 9 6
7 7 5 3 4
8 0 1 2 3
9 0 0 2 0
10 1 2 3 4

i need a formula to lookup the last time the value "0" was seen out of all 4 ranges

answer in f1=9(in reference to a1:a10(days)
Row 9 doesn't contain 4 zeros?

Maybe this...

Book1
ABCDEF
1101239
221020_
332354_
440023_
550123_
665896_
777534_
880123_
990000_
10101234_
Sheet1

This formula entered in F1:

=LOOKUP(2,1/(B1:B10&C1:C10&D1:D10&E1:E10="0000"),A1:A10)
 
Upvote 0
sorry for misconception

if any of the rows contain "0"
all of them dont have to be "0"

i just want to know when was the last day a "0" was seen in either range b1:e1
 
Upvote 0
sorry for misconception

if any of the rows contain "0"
all of them dont have to be "0"

i just want to know when was the last day a "0" was seen in either range b1:e1
Ok, try this...

=LOOKUP(2,1/(B1:E10=0),A1:A10)
 
Upvote 0
worked perfect, i swear u r a genius.

now using that same fashion, is there a way to count all the "0" in the ranges
 
Upvote 0
Like this:

=LOOKUP(2,1/((B1:E10=0)*(G1:G10="s")),A1:A10)


For this, I'll need to see sample data and tell me what result you expect.

i tried that and for some reason its not calculating right. i had to do it like this

=MAX(LOOKUP(2,1/((LOOKUP(2,1/((B1:b10=0)*(G1:G10="s")),A1:A10),LOOKUP(2,1/((c1:c10=0)*(G1:G10="s")),A1:A10),LOOKUP(2,1/((d1:d10=0)*(G1:G10="s")),A1:A10),LOOKUP(2,1/((e1:E10=0)*(G1:G10="s")),A1:A10)... please tell me there is a shorter way
 
Upvote 0
i tried that and for some reason its not calculating right. i had to do it like this

=MAX(LOOKUP(2,1/((LOOKUP(2,1/((B1:b10=0)*(G1:G10="s")),A1:A10),LOOKUP(2,1/((c1:c10=0)*(G1:G10="s")),A1:A10),LOOKUP(2,1/((d1:d10=0)*(G1:G10="s")),A1:A10),LOOKUP(2,1/((e1:E10=0)*(G1:G10="s")),A1:A10)... please tell me there is a shorter way
Try this array formula**:

=INDEX(A1:A10,MAX(IF(B1:E10=0,IF(G1:G10="s",ROW(A1:A10))))-ROW(A1)+1)

** array formulas need to be entered using the key
combination of CTRL,SHIFT,ENTER (not just ENTER).
Hold down both the CTRL key and the SHIFT key
then hit ENTER.
 
Upvote 0

Forum statistics

Threads
1,221,826
Messages
6,162,192
Members
451,752
Latest member
majbizzaki

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