Finding row number of the last date in a given month

tom82

New Member
Joined
Jul 9, 2019
Messages
2
Hi,
I have the below table

Line # Date Amount
2 15/1/2019 1000
3 28/5/2019 1500
4 28/5/2019 9999
5 28/5/2019 8888

I want to extract the row number of the last date that is after 30/4/2019 and prior to 30/5/2019.
So in this case the formula would return row 5.


Any idea on how to do that?
Thanks in advance!
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
welcome to the board

A simple Match formula might help: =MATCH([your end date here],B:B,1)

I'm using 1 as the third argument so it returns the last row that is less than the end value, rather than an exact match. I'm not currently testing for values larger than your start date
 
Upvote 0
welcome to the board

A simple Match formula might help: =MATCH([your end date here],B:B,1)

I'm using 1 as the third argument so it returns the last row that is less than the end value, rather than an exact match. I'm not currently testing for values larger than your start date

That won't work because the amount of dates in May is greater than the largest value in that sample.

Perhaps:
=LOOKUP(9.99999999E+307,IF(TEXT(B2:B5,"mm/yyyy")="05/2019",B2:B5),ROW(B2:B5))

Confirm with CTRL-SHIFT-ENTER rather than just Enter.
 
Upvote 0

Forum statistics

Threads
1,223,907
Messages
6,175,301
Members
452,633
Latest member
DougMo

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