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

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Try:

CFCG
2/29/18

<colgroup><col style="width: 25pxpx"><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]5[/TD]
[TD="align: right"]3/1/2018[/TD]
[TD="align: right"][/TD]

[TD="align: center"]6[/TD]
[TD="align: right"]3/31/2018[/TD]
[TD="align: right"][/TD]

[TD="align: center"]7[/TD]
[TD="align: right"][/TD]

[TD="align: center"]8[/TD]
[TD="align: right"]9[/TD]
[TD="align: right"]3/1/2018[/TD]

[TD="align: center"]9[/TD]
[TD="align: right"]15[/TD]
[TD="align: right"]3/1/2018[/TD]

[TD="align: center"]10[/TD]
[TD="align: right"][/TD]
[TD="align: right"]3/31/2018[/TD]

[TD="align: center"]11[/TD]
[TD="align: right"]8[/TD]
[TD="align: right"]3/31/2018[/TD]

[TD="align: center"]12[/TD]
[TD="align: right"]10[/TD]
[TD="align: right"]3/31/2018[/TD]

[TD="align: center"]13[/TD]
[TD="align: right"][/TD]
[TD="align: right"]3/31/2018[/TD]

[TD="align: center"]14[/TD]
[TD="align: right"][/TD]
[TD="align: right"]3/31/2018[/TD]

[TD="align: center"]15[/TD]
[TD="align: right"][/TD]
[TD="align: right"]3/31/2018[/TD]

</tbody>
Sheet6

[TABLE="width: 85%"]
<tbody>[TR]
[TD]Worksheet Formulas[TABLE="width: 100%"]
<thead>[TR="bgcolor: #DAE7F5"]
[TH="width: 10px"]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
</thead><tbody>[TR]
[TH="width: 10px, bgcolor: #DAE7F5"]CF8[/TH]
[TD="align: left"]=LOOKUP(2,1/($CG$7:$CG$15=CF5),ROW($CG$7:$CG$15))[/TD]
[/TR]
[TR]
[TH="width: 10px, bgcolor: #DAE7F5"]CF11[/TH]
[TD="align: left"]=MATCH(CF5,$CG$7:$CG$15,0)+ROW($CG$7)-1[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]




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
2/29/18

<colgroup><col style="width: 25pxpx"><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]5[/TD]
[TD="align: right"]3/1/2018[/TD]
[TD="align: right"][/TD]

[TD="align: center"]6[/TD]
[TD="align: right"]3/31/2018[/TD]
[TD="align: right"][/TD]

[TD="align: center"]7[/TD]
[TD="align: right"][/TD]

[TD="align: center"]8[/TD]
[TD="align: right"]9[/TD]
[TD="align: right"]3/1/2018[/TD]

[TD="align: center"]9[/TD]
[TD="align: right"]15[/TD]
[TD="align: right"]3/1/2018[/TD]

[TD="align: center"]10[/TD]
[TD="align: right"][/TD]
[TD="align: right"]3/31/2018[/TD]

[TD="align: center"]11[/TD]
[TD="align: right"]8[/TD]
[TD="align: right"]3/31/2018[/TD]

[TD="align: center"]12[/TD]
[TD="align: right"]10[/TD]
[TD="align: right"]3/31/2018[/TD]

[TD="align: center"]13[/TD]
[TD="align: right"][/TD]
[TD="align: right"]3/31/2018[/TD]

[TD="align: center"]14[/TD]
[TD="align: right"][/TD]
[TD="align: right"]3/31/2018[/TD]

[TD="align: center"]15[/TD]
[TD="align: right"][/TD]
[TD="align: right"]3/31/2018[/TD]

</tbody>
Sheet6

[TABLE="width: 85%"]
<tbody>[TR]
[TD]Worksheet Formulas[TABLE="width: 100%"]
<thead>[TR="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]
[TH="width: 10px"]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
</thead><tbody>[TR]
[TH="width: 10px, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]CF8[/TH]
[TD="align: left"]=LOOKUP(2,1/($CG$7:$CG$15=CF5),ROW($CG$7:$CG$15))[/TD]
[/TR]
[TR]
[TH="width: 10px, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]CF11[/TH]
[TD="align: left"]=MATCH(CF5,$CG$7:$CG$15,0)+ROW($CG$7)-1[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]




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,223,893
Messages
6,175,239
Members
452,621
Latest member
Laura_PinksBTHFT

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