Count 1st, 2nd occurrence in visible cells

georginalo

New Member
Joined
Feb 19, 2018
Messages
6
Hello, how to I count the 1st, 2nd, 3rd... occurrence in visible (filtered) cells?

I used =COUNTIF($A$7:$A7, $A7) with all cells, but how to convert to filtered cells?

The date I want to count is people's name, ie not number.

Thank you!
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Not sure i understand what you want. See if this example helps.

Before filter

A
B
C
1
Fruit​
Sales​
Formula​
2
Apple​
80​
1​
3
Banana​
100​
1​
4
Apple​
120​
2​
5
Cherry​
60​
1​
6
Banana​
70​
2​
7
Apple​
110​
3​
8
Apple​
40​
4​
9
Banana​
80​
3​
10
Apple​
120​
5​
11
Cherry​
110​
2​
12
Banana​
130​
4​
13
Apple​
120​
6​

<tbody>
</tbody>


Formula in C2 copied down
=SUMPRODUCT(SUBTOTAL(3,OFFSET(A$2:A2,ROW(A$2:A2)-ROW(A$2),0,1)),--(A$2:A2=A2))

Apply filter in Sales column
Criteria: Sales > = 100 (for example)

A
B
C
1
Fruit​
Sales​
Formula
3
Banana​
100​
1​
4
Apple​
120​
1​
7
Apple​
110​
2​
10
Apple​
120​
3​
11
Cherry​
110​
1​
12
Banana​
130​
2​
13
Apple​
120​
4

<tbody>
</tbody>

M.
 
Upvote 0
Yes, this is exactly what I wanted, thank you very very much!!!!!!:cool:
 
Last edited by a moderator:
Upvote 0

Forum statistics

Threads
1,213,543
Messages
6,114,237
Members
448,555
Latest member
RobertJones1986

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