Increment row values based on column values in Excel

Input File –
Expectedoutput.xlsx (10.0 KB)

Please add new column as “NewRowNo”

Always start the first row value with number “3”
If the next row “Key” column’s value is same previous row “Key” column value then increment + 1 in NewRowNo column

If the next row “Key” column’s value is NOT same previous row “Key” column value then increment + 2 in NewRowNo column

Expected output : Attached the expected output file
Expectedoutput.xlsx (10.0 KB)

Hello @Sathish_Kumar_S

Add data column "NewRowNo"
Assign int_Counter = 0
Assign str_PrevKey = ""

For each row in Data Table 
If row("Key").ToString=str_PrevKey
Then assign row("NewRowNo") = int_Counter+1
Else  assign row("NewRowNo") = int_Counter+2
Assign str_PrevKey = row("Key").ToString

Hope it makes sense :slightly_smiling_face:
If not then you are welcome to write me.

Regards
Soren