Home > Enterprise >  Create a unique ID based on 2 columns of data in Sheets
Create a unique ID based on 2 columns of data in Sheets

Time:06-30

Create a unique id based on 2 sets of criteria in sheets

enter image description here

CodePudding user response:

So, this is what I have tried, this is based on the date and the location, works with Excel, as OP mentioned is using MS365, hence may follow this

enter image description here

• Formula used in cell C2

=IFERROR(INDEX(C$1:C1,MATCH(1,(A2=A$1:A2)*(B2=B$1:B2),0)),MAX(C$1:C1) 1)

Works in Google Sheet as well,

enter image description here

=IFERROR(INDEX(C$1:C1,MATCH(1,(A2=A$1:A2)*(B2=B$1:B2),0)),MAX(C$1:C1) 1)

CodePudding user response:

use:

=INDEX(IF(B2:B="";;COUNTIF(A2:A&B2:B; A2:A&B2:B)))
  • Related