Order of occurrence of same value areas (formula

cerobit

New Member
Joined
Mar 7, 2023
Messages
3
Office Version
  1. 365
Platform
  1. Windows
Hello, I am trying to generate special identifier (string) based on document prefix and some additional connecting data. I have tried various ways, but with no succes :cautious:

Please see example below with a form of desired output. Any additional helping columns can be used, but a single formula/column would be nice.

Thank you for your help :)

order_of_occurrence_of_areas.xlsx
ABCDEF
1Document prefixData connectorDesired output document prefix & order of occurrence of the same color/prefix (connected areas through data connector)Progress so far…
2A1A1A1
3A2A2A2
4B3B1B1
5C4C1C1
6B5B2B2
7A6A3A3
8B7B3B3
9A8A4A4
10A8A4A5
11B9B4B4
12B10B4B5
13C11C2C2
14C11C2C3
15C11C2C4
16A12A5A6
17A13A6A7
18C14C3C5
19C15C4C6
20B16B5B6
21B16B5B7
22B16B5B8
23A17A7A8
24C18C5C7
25C18C5C8
26C19C6C9
27A20A8A9
28A21A9A10
29A21A9A11
30A21A9A12
31A21A9A13
32A22A10A14
33B23B6B9
example
Cell Formulas
RangeFormula
F2:F33F2=A2 & IF(COUNTIF($A$2:$A$33, A2) > 1, COUNTIF($A$2:A2, A2), "")
 

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.
Hi @cerobit, Welcome to the MrExcel forum. Please accept my warmest greetings and sincere hope that all is well.

It seems to me that you have a issue in your expected results in rows 11 and 12, since the values in columns B are different and in column D you did not consider an increment..

1678232817226.png


I did the adjustment, following the pattern of the other examples and I show you the result below:

Dante Amor
ABCD
1Document prefixData connectorDesired output
2A1A1
3A2A2
4B3B1
5C4C1
6B5B2
7A6A3
8B7B3
9A8A4
10A8A4
11B9B4
12B9B4
13C11C2
14C11C2
15C11C2
16A12A5
17A13A6
18C14C3
19C15C4
20B16B5
21B16B5
22B16B5
23A17A7
24C18C5
25C18C5
26C19C6
27A20A8
28A21A9
29A21A9
30A21A9
31A21A9
32A22A10
33B23B6
Hoja6
Cell Formulas
RangeFormula
D2:D33D2=A2&SUMPRODUCT(($A$2:A2=A2)*(MATCH($A$2:A2&$B$2:B2, $A$2:A2&$B$2:B3,0)=ROW($B$2:B2)-1))


Let me know the result and I'll get back to you as soon as I can.
Sincerely
Dante Amor
----- --
 
Upvote 1
Hi @DanteAmor !

Thank you for your reply.

You are right, the rows 11 and 12 are my bad, I have had an error in my problem's decription.

Your solution is exactly what I was trying to assemble. Than you again, this is awesome (y) :)

Regards,
cerobit
 
Upvote 1

Forum statistics

Threads
1,214,952
Messages
6,122,458
Members
449,085
Latest member
ExcelError

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