Instances of Occurrence of a unique item consecutively in excel

Deniel

New Member
Joined
Dec 4, 2022
Messages
3
Office Version
  1. 2010
Platform
  1. Windows
I have an excel item list where the rows are listed with several text items in a particular column, where many of the items are appeared consecutively with gap in between. I am desperately trying to find a formula (without VBA) which will give a incremental number starting with 1 for each consecutive appearance of a particular no. at column B Pl. help. The example excel sheet is placed for the desired result.
 

Attachments

  • excel sheet snapshot.jpg
    excel sheet snapshot.jpg
    71.8 KB · Views: 15

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
You will need 1 helper column for this one

Column B2: =IF(A2="A",IF(AND(A2="A",A1<>"A"),1,B1+1),"")
Column C2: =IF(A2="A",IF(A1="A",C1,SUMPRODUCT(--($B$2:B2=1))),"")
 

Attachments

  • wwwwwe.PNG
    wwwwwe.PNG
    37.4 KB · Views: 7
Upvote 0
Solution
You will need 1 helper column for this one

Column B2: =IF(A2="A",IF(AND(A2="A",A1<>"A"),1,B1+1),"")
Column C2: =IF(A2="A",IF(A1="A",C1,SUMPRODUCT(--($B$2:B2=1))),"")
This is what exactly I want. Your formula is amazing. I am trying to understand. Thank you so much.
 
Upvote 0
Another option without a helper column
Fluff.xlsm
AB
1
2
3
4A1
5A1
6B 
7B 
8A2
9C 
10D 
11A3
12A3
Data
Cell Formulas
RangeFormula
B4:B12B4=IF(AND(A4="A",A3="A"),B3,IF(A4="A",MAX(B$3:B3)+1,""))
 
Upvote 0
You can also try the below formula in cell B4 and then pulled down:

=IF(A4=A3,B3,MAXIFS($B3:B$3,$A3:A$3,A4)+1)
 
Last edited:
Upvote 0
The OP is using 2010 & therefore doesn't have the Maxifs function.
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0
Another variation

22 12 05.xlsm
AB
1
2
3
4A1
5A1
6B 
7B 
8A2
9C 
10D 
11A3
12A3
Count Groups
Cell Formulas
RangeFormula
B4:B12B4=IF(A4="A",IF(N(B3),B3,MAX(B$3:B3)+1),"")
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,022
Messages
6,122,716
Members
449,093
Latest member
Mnur

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