Hello all,
I use Microsoft 365 Excel
I have a column with fruit names and I know what the fruit names are.
I need a count for each fruit.
So, if I use the whole column A, then a COUNTIF function will work just fine, =COUNTIF(A:A,"Orange").
The challenge is B1 has the last row to be used in the count.
In other words, the range of cells for COUNTIF will be A1:A(whatever in B1)
For example: The preceding number below shows the row number in Col A.
1 Orange
2 Apple
3 Apple
4 Banana
5 Orange
6 Strawberry
7 Orange
8 Apple
So,
If B1 is 6, then the COUNTIF range is A1:A6 and the Orange count is 2
If B1 is 7, then the COUNTIF range is A1:A7 and the Orange count is 3
How do I write the COUNTIF range to accommodate the end range being a variable?
Or, maybe there is a different formula that will do the trick?
Thank you for any help.
Bookmarks