2nd Occurrence index match on dates

Henk2017

New Member
Joined
Jan 20, 2017
Messages
12
Hi all,

I have two rows:
- A date row
- A value row

I would like to retrieve a date where the corresponding 'value' is 0. However, it is possible that the first 3 values are 0, then 50, 30 and then 0 again. The formula should always return the date when a 0 follows after values > 0.


Dates1/1/20172/1/20173/1/20174/1/20175/1/20176/1/20177/1/20178/1/2017
Values0005030000

<tbody>
</tbody>

In the table above, the formula should return 6/1/2017. It is the first date that corresponds to value 0, following after some other positive values.

If someone could enlighten me with new formulas that would be awesome !
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Formula is (remember Ctrl+Shift+Enter end line):

Code:
{=IFERROR(INDEX($B$1:$I$1,MATCH(1,(B2:I2>0)*(C2:J2=0),0)+1),"")}

As Picture:

GR7ebMd.jpg
 
Upvote 0
Hi,

Based on your data residing in range A1:I2, try:

Code:
=INDEX(B1:I1,MATCH(2,1/(B2:I2<>0))+1)

Array entered, i.e. with CTRL+SHIFT+ENTER.

Note: This solution will always return the first date AFTER the last value <>0. If the last date in the range has a value <>0, then an error will occur (appropriate handling should then be applied).

Matty
 
Upvote 0
I found 1 formula new, I share us know now:

Formula:
Code:
=INDEX(B1:I1,LOOKUP(9E+307,(COLUMN(B1:I1)/(B2:I2<>0))))
 
Upvote 0
Formula is (remember Ctrl+Shift+Enter end line):

Code:
{=IFERROR(INDEX($B$1:$I$1,MATCH(1,(B2:I2>0)*(C2:J2=0),0)+1),"")}

As Picture:

GR7ebMd.jpg


This worked like a charm. Could you explain how the formula 'knows' that it should take the 2nd occurrence. I try to understand how the different parts solve my problem.

Thanks for your effort
 
Upvote 0

Forum statistics

Threads
1,214,391
Messages
6,119,239
Members
448,879
Latest member
VanGirl

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