How to find number of rows in a given sheet?

#1

I want to find last invoice number basis which next one to calculate. How to do it?

0 Likes

#2

Can you elaborate more on the above?

Incase you are trying to generate Invoice numbers the better idea is to have a Formula column in Sheets, we have a auto generating column called as unique_id in Sheets on which you can generate the Invoice number by writing a custom Formula.

Another idea is to generate the same Invoice number using a custom formula in Workflow after the submission is done (and unique_id is generated)as it will not have any conflicts.

Ideally it is never a good idea to generate an Invoice number on the UI as it has a probability of having conflicts with simultaneous submissions.

0 Likes

#3

You can use MAX() function and in the MAX() function you can LOOKUP() the unique_id sheet where you store invoices.

For instance, if the sheet name is Invoices, then you can use the formula -
MAX(LOOKUP(Invoices.unique_id))
This will return the largest value.

1 Like