Excel Help - Gurus ...
 

MegaSack DRAW - This year's winner is user - rgwb
We will be in touch

[Closed] Excel Help - Gurus required

12 Posts
9 Users
0 Reactions
55 Views
Posts: 4197
Full Member
Topic starter
 

I have a spreadsheet with two sheets in it.

Sheet A has a list of names in one column with points assigned to them in another column.

Sheet B has the same list of names and a column for points.

I want sheet B to compare the list of names to Sheet A and if the names match it puts that persons points from Sheet A into the column on Sheet B.

The order of the names in Sheet A and Sheet B can change depending on how I sort them.

I have tried IF, VLOOKUP and INDEX/MATCH functions.

This will save me a lot of effort if I can get it right!


 
Posted : 19/01/2021 7:31 am
Posts: 6858
Free Member
 

That’s exactly what VLookup is for.

Assuming sheet A has names in Col a and points in Col b, and sheet b has names in Col a.

In sheet b Col b you’d put:
=vlookup(name, range, 2, “FALSE”)

Name is your lookup value (link to the column immediately to the left).
Range is all the cells in sheet a - you probably want $ signs so the reference doesn’t change when you drag it down so it’ll be something like SheetA!$a$2:$b$100
2 because you want the second (points) column
False because it’s always false


 
Posted : 19/01/2021 7:39 am
 Mat
Posts: 873
Full Member
 

Ok so you have

Sheet A
Name | Data Column 1

Sheet B
Name | Data Column 2

Do you want
Sheet B
Name | Data Column 1 | Data Column 2

as in you want to add a new column to sheet B and add data to it if the Names match up?

For this sort of stuff I now use Power Query, it's nuts how powerful it is (to my non IT mind), it's opened up so much to me!

https://support.microsoft.com/en-us/office/add-a-column-from-an-example-power-query-cd82c570-8da7-4d70-91a1-3827b5995eab

If I've understood your Q right though I'll have a think about how to do it purely with Excel functions.

Edit: yeah what superficial says...


 
Posted : 19/01/2021 7:45 am
Posts: 4197
Full Member
Topic starter
 

Example date here:

https://docs.google.com/spreadsheets/d/1Ae2P7dGa6doUB3ghLdoTm2pKXTpH7WmW0B23jEdwgrs/edit?usp=sharing

I want the results sheet to sum all the points total from the various races in the appropriate column (the total is just a simple SUM function).

If possible I want to do the same on the time results spreadsheet as well


 
Posted : 19/01/2021 7:51 am
Posts: 4197
Full Member
Topic starter
 

Thanks @superficial that works great!


 
Posted : 19/01/2021 8:00 am
Posts: 25875
Full Member
 

don't forget

IF([name]="scaredypants",[points]+20,[points]-5)

I put that in all mine


 
Posted : 19/01/2021 8:11 am
Posts: 5052
Full Member
 

Just be aware that sorting can screw the vlookup

https://exceljet.net/excel-functions/excel-vlookup-function


 
Posted : 19/01/2021 8:16 am
Posts: 3072
Free Member
 

you could always use a simple pivot table, and create a vlookup over the top of that.

ie racea raceb racec total

boris x x x xx
nigel xx xx xx xxxx
nicola xxx xxxx xxx xx

then create the vlookup range using the columns names rather than selecting rows or a box


 
Posted : 19/01/2021 8:52 am
Posts: 4197
Full Member
Topic starter
 

Have tested sorting the data and looks like it doesn't affect the output so all is working as I wanted. Thank you all.

@scaredypants - nice try!


 
Posted : 19/01/2021 8:57 am
Posts: 12030
Full Member
 

don’t forget
IF([name]=”scaredypants”,[points]+20,[points]-5)

Excel functions puns - that's a new level of saddo!
Only surpassed by my good self who got it and chuckled. 🤣


 
Posted : 19/01/2021 9:11 am
Posts: 6332
Free Member
 

MATCH and INDEX does what VLOOKUP does but is better - more flexible and more robust.


 
Posted : 19/01/2021 12:40 pm
Posts: 6332
Free Member
 

=INDEX(sheetA_data, MATCH(name, sheetA_names, 0))


 
Posted : 19/01/2021 12:43 pm
Posts: 310
Full Member
 

you surely need the sumif formula. if you have many of one name in sheet a and you want the sum of all of those instances to be returned into one row in sheet b this will be the simplest way of doing it (it also just returns a 0 if there is no match for the name).

=Sumif(criteria range (the names on sheet a), criteria value (the name on sheet b), sum range (the range of values))


 
Posted : 19/01/2021 12:50 pm