Excel formula compare data in two columns, then use data in a 3rd column - excel-formula

I need a formula that will take the value in Col B, find the same value in column C, then input the corresponding value from Col D into Col A. Here is sample dataset:
Col A Col B Col C Col D
45 cat dog 12
12 dog cats 23
fish cat 45

Try this:
=IFERROR(INDEX($D$1:$D$3,MATCH(B1,$C$1:$C$3,0)),"")

Related

Can you match or search with cell matching part of another?

I'm trying to create a formula in Excel where I can use an Index / Match formula where I'm searching for only part of one cell.
For example:
Sheet 1
Column A --> Full Name
Column B --> Removed status
Col A
Col B
Col C
Col D
Col E
1
Col D + Col E
Removed status
agent #
Agent F Name
Agent L Name
2
Sheet 2
Column A --> Sheet 1 Column B --> only if Sheet 1 Column A is part of Sheet 2 Column D
Column D --> Full Name 1, Full Name 2, Full Name 3
Col A
Col B
Col C
Col D
Col E
1
Sheet 1 Col B
AutoP status
Carged
Name 1, Name 2, Name 3
Notes
2
So, I'm hoping to get a formula to display Sheet 1 Column B into Sheet 2 Column A only if Sheet 1 Column A can be found as part of Sheet 2 Column D.
Is this even possible?
If you want to search for part of one cell, you can use find formula which search for given text within cell value find(text,withintext) and it return index that the text start with and error if not.
And if you need your process to be work line by line,
the final formula ( for row2 of sheet2 column A ) would look like this:
=IF(AND(NOT(ISERROR(FIND(Sheet1!A2,Sheet2!D2))),Sheet1!A2<>""),Sheet1!A2,"")
if row2 of column A of sheet1 is not empty and is found (no error returned);the value of sheet1 column A returned otherwise empty will returned.
Hope that was useful.

How to retrieve a single cell

I have a table/excel sheet with below info:
Col A Col B Col C
1 3 ABC
CBA
2 4 TRA
DEP
How do I retrieve just first cell from Col C for every 1 and 2 in Col A
Results should be displayed like below
Col A Col B Col C Col D
1 3 ABC ABC
CBA
2 4 TRA TRA
DEP
3 5 TEA TEA
DEP
In Cell D1 place the following and copy down:
=IF(A1<>"",C1,"")
The above will display the value in Column C provided the corresponding value in A is not blank. If there was the possibility of TEXT being in Column A and you only want column C when its a number in column A you could go with the following.
=IF(ISNUMBER(A1),C1,"")

scan Excel column based on another column value

I want to check one entire column with value in another column and then assign a value in another column value to matching row cell.
Eg-
A B C D
1 10 X
2 3 Y
3 2 Z
4 11 K
What I want to do is take one value at a time from column A eg 1 and then scan through Column B if matches the Column A (value 1) then assign x to that row under D. eg if we check A3 ( value 2) with column B and found 2 is on B4 then D4 = Z. Like this I want to check all values in column in A against column B assign relevant vale from column C to Column D
How can I do this, can someone please help me.
Thanks.
Try:
= IFERROR(INDEX($C$2:$C$5,MATCH(A3,$B$2:$B$5,0)),"no match")
See below.
Try:
=IFERROR(VLOOKUP(A1,$B$1:$C$5,2,0),"")

Excel if vaules of 2 columns match then take the difference of another two columns

I have 4 columns of data. I want to match the values of two of the columns then if take the difference of two other columns if the first two match. So it's accounts and amounts.
Example. If col A matches Col C take the difference of Col B and Col D and Out it in Col E
Col A Col B Col C Col D Col E
1234 $100 1234 $100 $0
1235 $120 1235 $150 $-30
1236 $150 1237 $150
1238 $130
=IF(A1=B1,C1-D1,)
A1 and B1 are cell references to values you are comparing, and C1 and D1 are cell references to the values you are trying to take the difference of. If you'd like to have the cell be blank instead of 0, add "" after the last comma.
Assuming first data row to be A2:E2, Please put below mentioned formula in cell E2
=IF(A2=C2,B2-D2)
Similarly you can do reverse action by like if it is not then add them or put 0 or blank by "" or subtract B2 from D2 by below given options.
=IF(A2=C2,B2-D2,B2+D2)
=IF(A2=C2,B2-D2,0)
=IF(A2=C2,B2-D2,"")
=IF(A2=C2,B2-D2,D2-B2)
Hope this would help!

Find value in adjacent cell in excel

This is sort of what Im working with:
Col A Col B Col C
X 100 10
X 200 15
X 300 20
Y 100 12
Y 200 18
Y 300 24
What I want to do is to find the value in Col C where Col A is Y and Col B is 200. I used VLOOKUP to find the value in Col C where Col B is a certain value, but since I have multiple cells in Col B with the same values I need to specify which one of them I need to match with the value in Col C.
You could use a formula like:
=INDEX(C1:C6, SUMPRODUCT((A1:A6="Y")*(B1:B6=200)*ROW(C1:C6)), 0)
Note, however, that this will only work if the combination of values in column A and B are unique.

Resources