Additional Criteria for If Statement

dmill8023

Board Regular
Joined
Aug 24, 2012
Messages
60
Hello all! I am looking for help on expanding the logic on an If function I have. I am looking to create my own unique identifier for my data based on similar data in different columns. For example I start in A2 putting 1 under ID. In A3 I enter the following formula

=IF(AND(G3=G2,J3=J2),A2,A2+1).

What this returns after I drag it down my entire data set if G3+G2 as well as J3+J2 (all the way down for their respective columns) is similar is a similar ID number to work with. I want to add another column to this scenario and have not been able to find the solution. Basically I would like to include - if possible - column B and maybe column C to this as well.

Does anyone know a solution for this??? Please help it will be appreciated.
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
I'm basically trying to say if the values in G3+G2, J3+J2, and for example B3+B2 are all the same for their respective column give me the unique ID located in A
 
Upvote 0
Then just add more to the AND( ).

=IF(AND(G3=G2,J3=J2,B3=B2),A2,A2+1)
 
Upvote 0
Thank you dreid1011...that did it! I could've sworn I did that previously but obviously did not! THank you
 
Upvote 0

Forum statistics

Threads
1,215,231
Messages
6,123,754
Members
449,119
Latest member
moudenourd

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top