How to vlookup a combination of cells? - excel

There are two tables
table1
team member income
blue 650
Kate 500
Niki 150
green 1100
Kate 560
Alison 600
table2
team member income
blue 'vlookup what formula should I put here ?
Mike 'vlookup what formula should I put here ?
Kate 'vlookup what formula should I put here ?
Pete 'vlookup what formula should I put here ?
Niki 'vlookup what formula should I put here ?
red
Stew
Mark ............
Alex
green
Kate
Alison
I need to vlookup income from table1 and put in table2. The problem is that teams could have people with the same names . A record is uniquely identified by a team and a person name . How can i do this ?

With the layout shown you could try filling down this formula from G2:
=SUMPRODUCT((LOOKUP(ROW(A$2:A$7),ROW(A$2:A$7)/(A$2:A$7<>""),A$2:A$7)=LOOKUP("α",E$2:E2))*(B$2:B$7=F2)*C$2:C$7)

For convenience, you can create "helper" columns (which you can hide from view if needed):
Formulas:
C3: =IF(A3<>"",A3,C2)
D3: =IF(B3<>"",B3,A3)
E3: =C3&D3
Similarly for columns J, K and L. Formula in M3: =VLOOKUP($L3,$E$3:$F$14,2,FALSE) - a regular VLOOKUP.

Related

If a cell's value is found on another column, how to return the cell's value from another column which is on same row with the synced cell?

My Excel table is looking like this.
A column is the one that I want to fill in with correct data.
B column is where the lookup values are.
C column is the one where I want to extract data from.
D column is where data from B column will be searched.
For example, if data from B2 is found on D7 cell, I want to have in A2 the value from C7.
My Countries///My Codes////All Countries//////All Codes
AD Afghanistan AF
AU Albania AL
Algeria DZ
American Samoa AS
Andorra AD
Angola AO
Anguilla AI
Antarctica AQ
Antigua and Barbuda AG
Argentina AR
Armenia AM
Aruba AW
Australia AU
Austria AT
Azerbaijan AZ
It would be much appreciated your help because I would like to learn as much as I can about excel formulas.
Kind Regards,
Ioan
In A1 enter:
=INDEX(C$1:C$15,MATCH(B1,D$1:D$15,0))
and copy down:
Note:
MATCH() finds the row.INDEX() grabs the value.
Chris is right, looks like you need a vlookup, example
B1 would be
=Vlookup(A1,c1:d200,2,0)
B2 would be
=Vlookup(A2,c1:d200,2,0)
And so on
It works like this
Vlookup (value to lookup, range the lookup and return values are in, column number from range you want to return, exact match only (0 or false))
Though Chris's link is more detailed

Sum Multiple values in different Rows using Vlookup Function

A B
France 152
Italy 255
France 221
Spain 215
USA 222
Spain 155
I desire to add each value occurring in front of repeating countries using Vlookup function
Solution:
A B
France 373
Spain 370
If you use a SUMIF then you can total the columns
If the data starts in cell A1 then in cell C2 type
=SUMIF(A:A,A3,B:B)
then drag the formula down. this will give totals for each country
Or if you just want to show the first instance (where it says France for example) then use
=IF(COUNTIF(A$1:A2,A2)=1,SUMIF(A:A,A2,B:B),"")
You won't be able to do it with a vlookup.
You could use a pivot table which might be easier and that is useful for this exact type of question.
To get the list of repeating countries enter the following formula in Cell D2
=IFERROR(INDEX($A$2:$A$7,MATCH(1,INDEX((COUNTIF($D$1:D1,$A$2:$A$7)=0)*(COUNTIF($A$2:$A$7,$A$2:$A$7)>1),0,0),0)),"")
Then to get sum of corresponding country, in Cell E2 enter
=SUMIF($A$2:$A$7,D2,$B$2:$B$7)
Drag/Copy formulas as required. See image for reference.

Vlookup from another sheet using multiple columns

I have an excel workbook with 2 sheets.
Sheet 4 and Sheet 5:
Sheet 4 has the following columns:
type model name year
U acura jane 1998
D honda peter 2002
U bmz fred 1993
Sheet 5 also has the same columns but with an additional column sales.
type model name sales
U acura jane 2.3
D honda peter 3.8
U bmz fred 19
IN both the sheets, I created an additional column called "key" concatenating type-model-name (A2&B2&C2)
type model name year key
U acura jane 1998 Dacurajane
D honda peter 2002 Dhondapeter
U bmz fred 1993 Dbmzfred
To get the sales in Sheet1, I am giving the following vlookup.
=VLOOKUP(E2|Sheet5!A2:F4|5|FALSE)
I looked at other similar answers, trimmed the columns and did what the recommendations were, but it still returns #N/A
Can anyone point out what my mistake it?
Thanks In advance.
Use INDEX/MATCH
=INDEX(Sheet5!D:D, MATCH(E2, Sheet5!A:A&Sheet5!B:B&Sheet5!C:C, 0))
Enter with Ctrl-Shift-Enter
Also I am assuming that the sales is in column D of Sheet5. If different, put the appropriate column in as first parameter to the INDEX function.
Also please consider using restricted range references in the match function, instead of full column references - for speed & efficiency.
on cell E1 you will have KEY on cell E2 you will place =CONCATENATE(A2,B2,C2,D2) Combines contents above into a phrase "DFocusManuel2016". That should work for the combine part just paste that and drag down as desired on E2.
You can cover the rest of the cell population by simply assigning links to the cells so on cell A2,B2,C2 and D1 you will have =SHEETNAME!Y10 which Y10 corresponds to the source cell and Sheet name to the source sheet.

If Cell Contains XXX Then Return Corresponding Value

A B C D
1 Ross Sales John Guys Finance
2 Smith Sales Sam Andy #N/A or False
3 Guys Finance Mike Ross Sales
I'm putting this formula in cell "D1" but it's not giving me correct result
=IF(SUMPRODUCT(--ISNUMBER(SEARCH(A:A,C:C)))>0,B:B)
INDEX MATCH function would not work because it's not exact value
What can I put in "D1" and down to give me result as in the table above?
Try this in D2,
=LOOKUP(1E+99, SEARCH(A2, C:C), B:B)
'or cut down the full column references
=LOOKUP(1E+99, SEARCH(A2, C$2:C$4), B$2:B$4)
'alternately as a wildcard MATCH
=INDEX(B:B, MATCH("*"&A2&"*",C:C, 0))
Fill down as necessary.
      

Excel Index Partial match

I have Sheet1 with column A listing every single country in alphabetical order..
A
1 Afghanistan<
2 Albania
3 Algeria
4 American Samoa
5 Andorra
----------
228 United Kingdom
229 United States
etc
I have Sheet2 column A with empty cells with adjacent cells in column B listing address details
A B
1 empty cell Unit 3, Road;London, United Kingdom
2 empty cell Building 1, Road, TX, United States
3 empty cell 8th floor, Business Park, India 1234
etc
What I would like to know is how can I obtain the country within the address details in sheet2 column B and place them in Sheet2 column A, based on a match on the list of countries in Sheet1 column A.
Part of the problem is there is no coherent method as to how to country is placed within the address; could be at the end or in the middle of the address.
I have tried various index match formulas with no luck
any help would be appreciated.
I tried it with the reference table being in A1:B7, and lookups being A10:B10 onwards down. The formula is for these cells. You can adjust it for Sheet1/2!.
Assuming your data is in B10 onwards, and your reference data was in B1:B7, you can write this formula in A10 =INDEX($B$1:$B$7,MAX(IF(ISERROR(FIND($B$1:$B$7,B10)),-1,1)*(ROW($B$1:$B$7)-ROW($B$1)+1))). This is an array formula, so please hit Ctrl+Shift+Enter for excel to read it as an array formula.
(In the screenshot, I have pasted the table in A10:B12 as values only in D10:E12)
Text to Columns with a comma delimiter

Resources