web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :

Excel Snippets: Generate Row Numbers

Ian Grieve Profile Picture Ian Grieve 22,784
MicrosoftI might not post many Excel snippets, but I’m collecting them into a small Excel Snippets series to make them easy to find.

A while ago, I posted an article on generating row umbers in a SQL script; I fielded a question from someone recently on doing the same thing Excel where the row number changes based on two columns of data. Basically when either of the columns were different, the row number should reset back to 1.

The following formula uses an IF combined with an OR to check if either column of data is different to the row above and if so sets the row number to 1 otherwise it increments by 1:

=IF(OR(A2<>A3,B2<>B3),1,C2+1)

Read original post Excel Snippets: Generate Row Numbers at azurecurve|Ramblings of an IT Professional


This was originally posted here.

Comments

*This post is locked for comments