How to retrieve a single cell - excel

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

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.

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 :)

Excel index ,if and And

I have two sheets in excel. Sheet1 has A, B, C and D columns. Sheet2: A, B, E as columns. I want compare Sheet1 and Sheet2 columns (A&B) and write C from Sheet1 only if A&B in both sheets matches.
Eg:
Sheet1
A B C D
Sheet2
A B E
Add column C in Sheet2 only if A&B columns in both sheets matches
You can use vlookup function.
In Sheet1 you need to make a new column consisting of a and b at the beginning, for example:
Sheet1:
A B C
1 2 a
2 3 b
4 6 c
Sheet1 after changes:
new_column_A old_A B C
12 1 2 a
23 2 3 b
46 4 6 c
New_column_A can be created using formula =old_A1&B1
If you have this in your Sheet1 you can use vlookup function in your Sheet2 in column C to look for the values from Sheet1.
Sheet2
A B C
2 3 b
1 3 #N/D!
4 6 c
5 8 #N/D!
Your formula for C column would look like that:
=VLOOKUP(A1&B1,Sheet1!$A$1:$D$4,4,0)
If you don't want the #N/D! values you need to add IF condition:
=IF(ISERROR(VLOOKUP(A1&B1,Sheet1!$A$1:$D$4,4,0))=TRUE,"",VLOOKUP(A1&B1,Sheet!$A$1:$D$4,4,0))
Result:
A B C
2 3 b
1 3
4 6 c
5 8

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

Excel - Combine multiple columns into one column 3

What is the formula that we can use in Microsoft Excel to get the result of the value summation from string column A and string Column C if they are the same? Column B and Column D are both the number that assign to its respective column which is Column A and Column C. For example “orange” holds the value 6 (in Column B) for Column A while in Column C “orange” hold the value 2 (in column D).Final results should show the summation of 6+2=8 (in Column F) for string ‘Orange’ (Column E).
Thank you
Lupe
If you have this table:
A B C D
orange 1 orange 6
apple 2 apple 7
grapes 3 carrot 8
carrot 4 melon 9
And you want to search in column C for each of the A column values, you should use this in column E: (for E2, and drag down)
=IFERROR($B2+VLOOKUP($A2,$C$2:$D$5,2,FALSE), 0)
make sure to change $C$2:$D$5 to your range (in both places).
A B C D E
orange 1 orange 6 7
apple 2 apple 7 9
grapes 3 carrot 8 0
carrot 4 melon 9 12

Resources