Report

Comparing columns and returning value [Solved/Closed]

Ask a question ll - Last answered on Apr 14, 2017 at 01:58 AM by kittu
Hello,

I have an Excel spreadsheet where I want to compare values between two columns and return the value from another column.

EX:

Column: A     B     C     D 
        1     1     Z      Forumula: return value 
        1     2     Y  
        1     3     X 
        1     4     W 
        2     5     V 
        2     6     U 
        2     7     T 
        3     8     S 
        3     9     R 



What I would like to happen in column D is for it to look at what is in column A, find the matching value in column B, and return the value listed in C. i.e. for any value of '1' in column A, I would want column D to display 'Z', for any value of '2' in column A, I would want column D to display 'Y', for any value of '3' in column A, I would want column D to display 'X', etc.

Could someone help?

Thanks!
See more 
Helpful
+21
plus moins
Hi

Use in Cell D1 the formula, =VLOOKUP(A1,$B$1:$C$9,2,FALSE)


Do let me know If it helps...
Was this answer helpful?  
bath- Jul 30, 2009 at 03:56 AM
a1 418
a2 817
a3 525
a4 635
a5 254
a6 852
a7 969
a8 857
a9 568
a10 963
a11 254

when I put a9 in column A1 , COLUMN D1 should return the value 568, when I put a5 in colum A1, then column Di should return the value 254, like that...can u assist ?
Nitin- Nov 26, 2012 at 05:16 AM
=IF(D6=1,"Z",IF(D6=2,"Y",IF(D6=3,"X",FALSE)))

A B C D
1 1 Z Z
1 2 Y Z
1 3 X Z
1 4 W Z
2 5 V Y
2 6 U Y
2 7 T Y
3 8 S X
3 9 R X
kittu- Apr 14, 2017 at 01:58 AM
Bang on!! This is exactly what i was looking for. Thank you so much
Reply
Helpful
+16
plus moins
Hi

Use the formula (in cell D1) =VLOOKUP(A1,$B$1:$C$9,2,FALSE)
Do let me know If it helps...
ll- May 29, 2009 at 01:15 PM
Thanks so much, the VLOOKUP formula worked! I wouldn't have figured it out on my own... I think I understand it, but not sure what the '2' does in the 2,FALSE part of the formula. If you'd like to explain, that'd be great, if not, you've helped enough and saved me hours of work!

Thanks!
Mike- Apr 26, 2010 at 03:52 AM
Thanks folks, it really is helpful...
Keep up the good work
Avo- Jul 19, 2013 at 12:14 PM
OMG this formula has just saved me from tearing my hair out, THANK YOU!
aaaa- Oct 10, 2013 at 10:39 AM
ballin out - very simple formula, thank you for helping
Helpful
+6
plus moins
Put this formula =CHAR(91-A1) in Cell D1 and drag it down. It will give you Z to A for the values of 1 to 26.
D1==CHAR(91-A1)

C1==CHAR(91-b1)
Helpful
+6
plus moins
Hi,

I've been driving myself crazy on excel trying to figure out a formula to calculate the responses for a test. Here's what I need it to do:

If the value in cell A2 matches the value in cell B2, I need it to display a 1.
If the value in cell A2 does NOT match the value in cell B2 and is not blank, I need it to subtract .25 or display -.25 (whichever).
If there is no value in cell A2 (if it's blank), I need it to display 0.

I can't find this anywhere because nothing explains how to pick between 3 inputs and then return one of 3 values.

Hope you can help.
rizvisa1 4482Posts Thursday January 28, 2010Registration date ContributorStatus January 6, 2016 Last seen - Aug 7, 2010 at 07:15 PM
Seems to be a totally different question. It is better if you start a new thread
Helpful
+5
plus moins
Hi

Use =VLOOKUP(A1,$B$1:$C$9,2,FALSE)
in cell D1 and copy downwards

Do let me know If it helps...
Natdev- Jun 10, 2009 at 08:26 PM
Hi,
This is my dilema , I obviously am missing something here

Old record New record

1 1
4 4
3 5
5 6
7 8
8 9

How do I get Column C to give me :
1. If the same values in A and B to show the same in C using False AND
2. If the values are not the same then #N/A in Column C

I seem to be challenged trying to use one vlookup formula to compare all the values of Column A and B to display the result in C.
Please help.
mubashir aziz 191Posts Sunday April 12, 2009Registration date February 16, 2010 Last seen - Jun 10, 2009 at 10:27 PM
Suppose your data is in Row 1 then use this formula and drag it down ........ it will see A1 values in whole column of B and if find then give you the value ......

=VLOOKUP(A1,$B$1:$B$6,1,FALSE)


lovingthecurls- Aug 25, 2010 at 06:56 PM
this helped me a lot. thanks mubashir aziz! :)
Helpful
+4
plus moins
Hello all,

Assume that in A1:C5 I have the following table:
A B C
1 1 Low
2 1 Low Mod
3 1 Moderate
4 1 Mod High
5 1 High

And I have in Row 10 the following:

Row 10: A10=3 and B10=1

What sort of formula do I need to create in C10 that would look up the value from the table above (A1:C5) and would match the value of A10 to the relevant value in column A, and does the same for the value in B10 to the relevant value in column B so that the outcome is the corresponding value in column C... C3 = "Moderate"

Your assistance is highly appreciated.
rizvisa1 4482Posts Thursday January 28, 2010Registration date ContributorStatus January 6, 2016 Last seen - Aug 23, 2010 at 02:04 PM
=INDIRECT("C" & SUMPRODUCT((A1:A6=A10) * (B1:B6=B10) * ROW(B1:B6)))
Helpful
+3
plus moins
Hello. Here is my scenario/problem.

I want a formula that will populate column D with the results of the following. It will find anything in column A that also appears in column B. If it appears in column B it will display the associated value from column C.

Make sense? Please help...
rizvisa1 4482Posts Thursday January 28, 2010Registration date ContributorStatus January 6, 2016 Last seen - Mar 12, 2010 at 04:53 AM
I think you need an IF statement

=IF(condition, true action, false action)

Lets say we are working in row 2

then in D2, you can write

=IF(A2=B2, C2, "")

Which says that if a2 is same as b2, then show value of c2 else just show blank ("")
Helpful
+2
plus moins
Hello,

Please help me, what is the formula to get the value from column B that is not in column A?

I have compare new data I want to find out what is the new value that has been added to B that is not

in A. I know how to use vlookup basic but it's a bit complicated since it will only show 1 result as well as with

the exact formula it will only show false and I still have to dig in the values one-by one to get the value that

doesn't really have a matching value in the spreadsheet.
mubashir aziz 191Posts Sunday April 12, 2009Registration date February 16, 2010 Last seen - Sep 4, 2009 at 01:17 AM
Suppose you are compaing Col. B with Col A. now write this formula in C1 and drag it down ... hope it will help you ......

=IF(ISERROR(VLOOKUP(B1,$A$1:$A$8,1,FALSE)),"New Data","")


shakeel ahmed- Nov 12, 2009 at 10:50 AM
Dear brother

=IF(ISERROR(VLOOKUP(B1,$A$1:$A$8,1,FALSE)),"New Data","")

is a very nice formula which provide u. I use it same u ask and I find correct value which I want.


keep it up to share these types of information

May Allah Help u

Thanks & Regards

Shakee Ahmed
Helpful
+1
plus moins
Although you question is quite confusing because in your title you are asking to compare two column which means you want to compare but in your example you are talking about A & B Separately.

Anyway, Copy below formula in Cell D1 and it will give you the values of 1 to 26 from Z to A.

D1=CHAR(91-A1)

For

C1=CHAR(91-B1)

For any confusion don't hesitate to consult with me.........
Helpful
+0
plus moins
Put this formula in Cell D1 and drag it down. It will give you Z to A for the values of 1 to 26.

D1=CHAR(91-A1) and drag it down ......

ll- May 29, 2009 at 01:20 PM
Thanks for the response Mubashir - I used the numbers/alphabet to illustrate my example, I actually have words/amts etc. that I was trying to match up, I should have been clearer on that - good formula to know though!
Helpful
+0
plus moins
This is the syntax of Vlookup .... in your formula 2 is the nth column in Range .... If you will not False in the formula then it will return you closest match and will not return any error ......


VLOOKUP(lookup_value,table_array,col_index_num,range_lookup)

Lookup_value is the value to be found in the first column of the array. Lookup_value can be a value, a reference, or a text string.

Table_array is the table of information in which data is looked up. Use a reference to a range or a range name, such as Database or List.

If range_lookup is TRUE, the values in the first column of table_array must be placed in ascending order: ..., -2, -1, 0, 1, 2, ..., A-Z, FALSE, TRUE; otherwise VLOOKUP may not give the correct value. If range_lookup is FALSE, table_array does not need to be sorted.

You can put the values in ascending order by choosing the Sort command from the Data menu and selecting Ascending.

The values in the first column of table_array can be text, numbers, or logical values.

Uppercase and lowercase text are equivalent.








Helpful
+0
plus moins
Hi all,

Is there a way to compare the contents of a cell with a different cell using TRUE/FALSE results?

For instance,
cell A1 contains: Jr3
comparing with
cell B1 contains: Jr3

cell C1 (the result cell) will show up TRUE

now what if I want to match the content of B1 with cell A1 which contains more than one value in it?
For instance,
cell A1: Jr3, Jr4
comparing with
cell B1 containing Jr3

cell C1 should show up TRUE (since cell A1 does have Jr3 as its value separated by a comma)

Please Help
rizvisa1 4482Posts Thursday January 28, 2010Registration date ContributorStatus January 6, 2016 Last seen - Sep 1, 2010 at 06:35 PM
You can use find to do that
Walter- May 15, 2013 at 07:32 AM
Please help me check and correct this formula =IF(AND(OR(A10=3,B10<=1,A10=3,B10=2,A10=2,B10=3,A10<=1,B10=3),"3","2","1","0")))
Chandu- Jun 13, 2013 at 11:08 PM
What if the compared cell is a merged cell. Example, comparing the values in column C with the merged cell values in Column A, expecting the result of the values from column B.

A B C D(Result)
1 x 1
y 2
2 z 3
3 c 4

Where A1 is a merged cell which takes 2 cell places. Please help me with this!!
guru- Jan 10, 2014 at 03:41 PM
more garbase
guru- Jan 10, 2014 at 03:41 PM
garbage...i mean

Member requests are more likely to be responded to.

Members can monitor the statuses of their requests from their account pages.

A CCM membership gives you access to additional options.

Not a member yet?

Sign up now. It takes less than a minute and is completely free!