Excel - Match 2 columns and paste result from appending cell - excel

From the table below, I want to match 'COLUMN A' and 'COLUMN C', when the match happens, the value from 'COLUMN D' should be pasted in 'COLUMN B'.
Column A Column B Column C Column D
AB FAST AE APPLE
CD RAINBOW EF BANANA
EF BANANA AG CARROT
GH HAMSTER ET DOG
WE EYE
AB FAST
GF GOOGLE
GH HAMSTER
HJ JOKER
ER LION
CD RAINBOW
Expected result:
COL A COL C COL D COL B
'AB' matched 'AB' extract value from 'FAST' and paste in FAST

Select your table including the headers, click insert and then click table. Paste the following formula in COLUMN B INDEX(Table1,MATCH([#[Col A]],[Col C],0),4)

Related

Excel: Sort column to match values of another column

I've got a problem with an excel sheet with 4 columns where two columns rely on each other because Column A is the name and column B is the quantity, the same thing with columns C and D.
Table
==========================================
A B C D
Apple 54 Banana 12
Peanut 6 Pineapple 4
Cranberry 112 Cherry 40
Cookie 3 Peanut 4
Banana 2 Cranberry 5
Peach 3 Almond 10
Cherry 5
Cheese 10
What I want to get is that each content of column C with the quantity in column D will be placed in the same row as their matching part in column A so I can compare the quantities between B and D. All the values with no matching partner should be placed at the bottom or just with an empty table, so I know there is no match.
Example how it should look like:
Table
==========================================
A B C D
Apple 54
Peanut 6 Peanut 4
Cranberry 112 Cranberry 5
Cookie 3
Banana 2 Banana 12
Peach 3
Cherry 5 Cherry 40
Cheese 10
Almond 10
Pineapple 4
This should solve your problem: =VLOOKUP(C2;$A$2:$B$9;2;TRUE)
You simply add this as a column "E" in your spreadsheet and drag it down then you can compare the values.
Col A remains as it is.
Col B remains as it is.
Col C moves to Col E.
Col D moves to Col F.
New Col C, Cell C1 = =IFS(AND(A1<>"",(COUNTIF($E$1:E, A1)=1)=TRUE),A1,AND(A1<>"",(COUNTIF($E$1:E, A1)=1)=FALSE),"",A1="",ArrayFormula(INDEX($E$1:E,SMALL(IF(ISERROR(MATCH($E$1:E,$A$1:A,0)),(ROW($E$1:E)-MIN(ROW($A$1:A))+1),""),SUM(ROW(1:1)-COUNTA($A$1:A1))))))
Copy this down from C1
New Col D, Cell D1 = =IF(C1="","",VLOOKUP(C1,$E$1:F,2,FALSE))
Note: I wrote this in Google sheets, So when I type ctrl + shift + enter it coverts it into ArrayFormula(). You will need to do an array formula the excel way - ctrl + shift + enter and remove the ArrayFormula().
Feel free to view this in a sheet - https://docs.google.com/spreadsheets/d/10hygbPyzj7L1u77izejoeGriaquoZ_omp49pCJ2U7uE/edit?usp=sharing
If you want to export the sheet. Right click the "sheet 1" tab, go to "copy to" and "new spreadsheet"
Any questions, let me know :)

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,"")

If Cell Value is present in a range of Cells

I have an excel file:
A B C D E F
1000603 90 1000702 Chocolate PCS
1000965 22 1000232 Apple BOX
1008596 56 1555254 Burger PCS
1000323 95 1000702 Candy BOX
1555254 63
1000702 88
Column A and B is my Master List of Barcodes
What I want to do is:
If a value from Column C matches from the Column A, the value in Column B will be placed in Column F
Example:
C D E F
1000702 Chocolate PCS (formula that will be equal to B6) 88
What I have done so far was to play with the answer in this question, but I have not found the correct formula for my need: if a cell equals any cell in a range
Use simple =VLOOKUP function. Put following formula to F1 cell then fill down as required.
=VLOOKUP(C1,A:B,2,FALSE)

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!

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

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)),"")

Resources