Search code examples
excelexcel-formulaauto-incrementlibreoffice

Libre , Increment test case number after 2 rows


This should be easy but I have test cases that should increment by one after every two rows.

Picture attached of what I want it to look like, there must be a formula I can use to do this for me.

I've tried online but nothing is helping with what I need it to doenter image description here

Attempted - ="TC"&IF(A6=A5,A6+1,A6)

and got enter image description here


Solution

  • With cell 1 containing 1 and cellA2 containing 1, try this in cell A3 and drag down :

    =IF(A2=A1,A2+1,A2)
    

    I didn't use your complete name but you could use the ampersand for that part :

    ="TXT"&IF(A2=A1,A2+1,A2)
    

    After me making an error, this works :

    ="TC"&IF(MID(A2,3,10)=MID(A1,3,10),MID(A2,3,10)+1,MID(A2,3,10))