using the output (last row number) of a function for another function, say, COUNTIF

Zakky

Board Regular
Joined
Mar 26, 2016
Messages
145
Office Version
  1. 365
Platform
  1. Windows
Hi, I have used a formula (thanks to Mr. Excel.com team) to find the last populated row. I want to link/feed this number to another function, say, COUNTIF. how can i reference the last cell number into the Countif function?

my formula in cell A2 is =MAX((G:G<>"")*(ROW(G:G))) which returns 234814. Now i want to do in cell E1 =COUNTIF(E2:E234814,"A"). I want to make COUNTIF dynamic, so as length of data changes the Countif picks up the last row and updates automatically without me having to adjust it to last row manually. I changed E234418 to A2 but it didn't work. Thank you.
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Try this...
=COUNTIF(INDIRECT("E2:E" & A2),"A")

Alternatively, reference the entire column in the formula. It doesn't slow Excel down. Excel formulas inherently know what the last used row on the sheet is.
=COUNTIF(E:E,"A")
 
Upvote 0
AlphaFrog, marvelous job! Both functions work. Always good to have a choice :). have a nice day/evening, and, thank you!.
 
Upvote 0

Forum statistics

Threads
1,215,334
Messages
6,124,321
Members
449,154
Latest member
pollardxlsm

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