Last check mark in a column

anwaee2

Board Regular
Joined
Sep 13, 2012
Messages
151
Office Version
  1. 2011
Platform
  1. MacOS
I have a column that I place check marks in if a certain condition is met. Some cells are checked and some are empty. I need to find the row number of the last checked cell. There will be only check marks or empty cells in in this column. And thanks again for all the wonderful help in the past.
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Like
Code:
Range("B"&rows.Count).End(xlUp).Row
 
Upvote 0
Like
Code:
Range("B"&rows.Count).End(xlUp).Row

Sorry, I should have mentioned that I need to do this with a worksheet formula. I have more than one column that I need to do this with. I am trying to find how many days since last check mark. I have a formula that works for the dating part but need to find the row number.
 
Upvote 0
=MATCH(REPT("z",255),A:A)

yields the native row number of the last character in column A, even that's a blank.
 
Upvote 0
=MATCH(REPT("z",255),A:A)

yields the native row number of the last character in column A, even that's a blank.

Maybe I didn't explain myself well. None of the above seem to work for what I need. I needed the row number of the last row in a single column that had a check mark in it. After more research I found this that works exactly as needed.

=SUMPRODUCT(MAX((B6:B41<>"")*ROW(B6:B41)))

As used in the complete formula:

=IF(SUMPRODUCT(MAX((B6:B41<>"")*ROW(B6:B41)))>0,DATEDIF(INDIRECT("A"&SUMPRODUCT(MAX((B6:B41<>"")*ROW(B6:B41)))),TODAY(),"D"),"")

The other formulas either gave me the first row number which was empty or the very last row in the range. I want to thank all for trying. Sorry I didn't explain it better.
 
Upvote 0
Maybe I didn't explain myself well. None of the above seem to work for what I need. I needed the row number of the last row in a single column that had a check mark in it. After more research I found this that works exactly as needed.

=SUMPRODUCT(MAX((B6:B41<>"")*ROW(B6:B41)))

As used in the complete formula:

=IF(SUMPRODUCT(MAX((B6:B41<>"")*ROW(B6:B41)))>0,DATEDIF(INDIRECT("A"&SUMPRODUCT(MAX((B6:B41<>"")*ROW(B6:B41)))),TODAY(),"D"),"")

The other formulas either gave me the first row number which was empty or the very last row in the range. I want to thank all for trying. Sorry I didn't explain it better.

=MATCH(REPT("z",255),B6:B41)

will give you relative row number.

=MATCH(REPT("z",255),
B:B)

will give you native row number.

This idiom is very fast.

 
Last edited:
Upvote 0
=MATCH(REPT("z",255),B6:B41)

will give you relative row number.

=MATCH(REPT("z",255),
B:B)

will give you native row number.

This idiom is very fast.


Thank you again. I can see where that would be faster. It works great except my formula is in the same column and I get a circular reference error using the MATCH/REPT formula you provided. I have dates in column "A" and I check off the tasks performed on that day in the next 7 columns with the fomula at the bottom letting me know how many days since it was performed last. The SUMPRODUCT formula is working fast enough for me at this point. Again thanks for the solution. I may use a helper column with the MATCH/REPT formula to make my formula simpler.
 
Upvote 0
Which formula did you try and where have you implemented that formula?

I used this:

=IF(ISERROR(DATEDIF(INDIRECT("A"&MATCH(REPT("z",255),B:B)),TODAY(),"D")),"",DATEDIF(INDIRECT("A"&MATCH(REPT("z",255),B:B)),TODAY(),"D"))

In cell "B43". Column "A" has the dates the tasks in columns "B" thru "H" have the check marks in.
And I might mention it works fine if I put it in any other column.

DateMowEdgeWeedsLeaves2, 4DRoundupWeed & FeedSeeded

<tbody>
</tbody>

Row 43 Has the days from last checked.

This formula is now in Cell "B43" and seems to be working fine:

=IF(SUMPRODUCT(MAX((B6:B41<>"")*ROW(B6:B41)))>0,DATEDIF(INDIRECT("A"&SUMPRODUCT(MAX((B6:B41<>"")*ROW(B6:B41)))),TODAY(),"D"),"")

Hope this explains it better.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,632
Messages
6,120,652
Members
448,975
Latest member
sweeberry

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