Finding Row Number for a Date

rwmill9716

Active Member
Joined
May 20, 2006
Messages
493
Office Version
  1. 2013
Platform
  1. Windows
Cell CF8 = MATCH(Date(Year(CF5), Month(CF5), Day(CF5)), $CG:$CG)
Cell CF9 = MATCH(Date(Year(CF6), Month(CF6), Day(CF6)), $CG:$CG)

I'm reading dates in CF5 and CF6, and then finding the row number in column CG where these dates can be found. Row 9 is the last appearance of 3/1/2018 and Row 15 the last appearance of 3/31/2018. What I need is a formula for cell CF9 that identifies the first appearance of 3/1/2018, i.e., 8 in cell CF8.


Excel 2012
CFCG
53/1/2018
63/31/2018
72/29/18
893/1/2018
9153/1/2018
103/31/2018
113/31/2018
123/31/2018
133/31/2018
143/31/2018
153/31/2018
HMD
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Try:

CFCG
53/1/2018
63/31/2018
72/29/18
893/1/2018
9153/1/2018
103/31/2018
1183/31/2018
12103/31/2018
133/31/2018
143/31/2018
153/31/2018

<colgroup><col style="width: 25pxpx"><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet6

Worksheet Formulas
CellFormula
CF8=LOOKUP(2,1/($CG$7:$CG$15=CF5),ROW($CG$7:$CG$15))
CF11=MATCH(CF5,$CG$7:$CG$15,0)+ROW($CG$7)-1

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>




I'm not sure why you're using YEAR/MONTH/DAY to split your date apart, then DATE to put it back together. I might recommend the LOOKUP formula instead, in case you have dates not in order.

And another thought, why do you need the row number? To feed into another formula? If so, what is it? There may be a better way than using a row number.
 
Last edited:
Upvote 0
Try:

CFCG
53/1/2018
63/31/2018
72/29/18
893/1/2018
9153/1/2018
103/31/2018
1183/31/2018
12103/31/2018
133/31/2018
143/31/2018
153/31/2018

<colgroup><col style="width: 25pxpx"><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet6

Worksheet Formulas
CellFormula
CF8=LOOKUP(2,1/($CG$7:$CG$15=CF5),ROW($CG$7:$CG$15))
CF11=MATCH(CF5,$CG$7:$CG$15,0)+ROW($CG$7)-1

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>




I'm not sure why you're using YEAR/MONTH/DAY to split your date apart, then DATE to put it back together. I might recommend the LOOKUP formula instead, in case you have dates not in order.

And another thought, why do you need the row number? To feed into another formula? If so, what is it? There may be a better way than using a row number.

Thanks, Eric,

This works.

Ric
 
Upvote 0

Forum statistics

Threads
1,216,099
Messages
6,128,816
Members
449,469
Latest member
Kingwi11y

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