Home > OS >  Excel, how to dynamically modify column cells until next different value
Excel, how to dynamically modify column cells until next different value

Time:03-15

For example:

enter image description here

I want it to become:

enter image description here

This clearly has to be done dynamically.

CodePudding user response:

In Office 365 you could create the required result in a different column/sheet with this formula: =A1:A11&IF(COUNTIF(OFFSET(A1,,,SEQUENCE(COUNTA(A1:A11),),),A1:A11)-1=0,"","_"&COUNTIF(OFFSET(A1,,,SEQUENCE(COUNTA(A1:A11),),),A1:A11)-1)

Or using LET:

=LET(data,A1:A11, 
     countif,COUNTIF(OFFSET(data,,,SEQUENCE(COUNTA(data))),data)-1,
     data&IF(countif=0,"","_"&countif))

enter image description here

If you want the data replaced with the amended data you need a VBA solution

  • Related