How to compare values in two columns in an excel sheet and populate a value in another column

aparicitudu

New Member
Joined
Aug 10, 2009
Messages
8
Hi,

My requirements says to compare two i.e column A value with range of values and column B value with range of values and then populate column C with 1 or 0 based on the compare result.

ABCDEF
NEWRAHUL1000
PROGRESSRAHUL0100
COMPLETEDRAHUL0010
NEWRAVI0001

<tbody>
</tbody>

For Example:

A B C D
NEW RAHUL 1(IF (A="NEW" & B="RAHUL") 1 (IF (A="PROGRESS" & B="RAHUL").....
PROGRESS RAVI ...... ........
COMPLETED RAHUL ....... ........


Please help me out in finding a solution for this. :)

Thanks,
Aparichit.
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Hi,
Sorry for being not clear.
Let me keep it in this way.
Column A can have values NEW, PROGRESS, COMPLETED.
Column B can have values RAHUL, RAVI
Column C can have two values either 0 or 1
when column A=NEW and column B=RAHUL, then C=value 1
For remaining cases column C should have value 0.

In the same way column D can have either 0 or 1 value.
value 1 only when column A=PROGRESS and column B= RAHUL
For remaining cases column D should have value 0.
The same way column E and F also as shown in above table.
I believe this will give a clear idea of my requirement.

Thanks,
Aparichit.
 
Upvote 0
Hi aparicitudu

If I'm understanding correctly if you put the following formula in column c:

=if(and(A1="NEW",B1="RAHUL"),1,0)

If you use the same method you should be able to complete the other columns

Hope I've understood what you meant!!!

Thanks
Ant
 
Upvote 0
This should surely work for you.

Formula in Column C =IF(AND(A2="NEW",B2="RAHUL"),1,0)
Formula in Column D =IF(AND(A2="PROGRESS",B2="RAHUL"),1,0)
Formula in Column E =IF(AND(A2="COMPLETED",B2="RAHUL"),1,0)
Formula in Column F =IF(AND(A2="NEW",B2="RAVI"),1,0)

Exactly same as the solution provided by anthorne but this would save you some seconds of time and some stress on your brain :P
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,028
Messages
6,122,749
Members
449,094
Latest member
dsharae57

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