Formula to match data

RattlingCarp3048

Board Regular
Joined
Jan 12, 2022
Messages
166
Office Version
  1. 365
Platform
  1. Windows
I am trying to match data from one sheet to the next. I tried a vlookup but keep getting the #spill! error. Maybe you guys can help? Basically what i am trying to do is.... we have multiple employees with an assigned department but they cross train in other departments. I need to line their hours up in the appropriate fields. On Sheet #1 I need columns F, G, and H to search for the name in A + Packing, Produce, or register and return the value. This is a small example, there are many many more names so limiting the search to the name would not be dynamic enough. I would prefer a formula if possible rather that VBA.

In this case F2 should search for Matt + Packing and return 4.
F3 should search for John + Packing and return 17 etc...

Then G3 should search for John + Produce and return 1.

Then H4 should search for Annie + Register and return 15.


1643656821163.png
1643657337356.png
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
If you are getting a #Spill error that suggests you are using either 365 or 2021, rather than 2010 which your profile shows. I would suggest that you update your profile.

Maybe
Excel Formula:
=FILTER(sheet4!C6:C20,(sheet4!A6:A20=A2)*(sheet4!B6:B20="Packing"))
 
Upvote 0
Hi,

If you adjust your Headers in Sheet1, you can use a Single formula using SUMIFS.
If you don't change the Headers, you'll need to use 3 separate formulas, hardcoding "Packing", "Produce", etc.
Add Sheet4 name to formula:

Book3.xlsx
ABCDEFGH
1PackingProduceRegister
2Matt400
3John1710
4Annie15015
5Sue0012
6MattPacking4
7JohnProduce1
8JohnPacking17
9SueRegister12
10AnniePacking15
11AnnieRegister15
Sheet979
Cell Formulas
RangeFormula
F2:H5F2=SUMIFS($C$6:$C$11,$A$6:$A$11,$E2,$B$6:$B$11,F$1)
 
Upvote 0
If you are getting a #Spill error that suggests you are using either 365 or 2021, rather than 2010 which your profile shows. I would suggest that you update your profile.

Maybe
Excel Formula:
=FILTER(sheet4!C6:C20,(sheet4!A6:A20=A2)*(sheet4!B6:B20="Packing"))
updated to 365.

#Calc! error
 
Upvote 0
That means there are no cells on sheet4 that match both criteria.
Have you tried jtakw's suggestion? If so what does that return?
 
Upvote 0
Hi,

If you adjust your Headers in Sheet1, you can use a Single formula using SUMIFS.
If you don't change the Headers, you'll need to use 3 separate formulas, hardcoding "Packing", "Produce", etc.
Add Sheet4 name to formula:

Book3.xlsx
ABCDEFGH
1PackingProduceRegister
2Matt400
3John1710
4Annie15015
5Sue0012
6MattPacking4
7JohnProduce1
8JohnPacking17
9SueRegister12
10AnniePacking15
11AnnieRegister15
Sheet979
Cell Formulas
RangeFormula
F2:H5F2=SUMIFS($C$6:$C$11,$A$6:$A$11,$E2,$B$6:$B$11,F$1)
The headers cannot be changed. I added the sheet names but it returned a 0.
 
Upvote 0
In that case as I said before. There is nothing on sheet4 that matches both criteria. Check for typos & leading/trailing spaces.
 
Upvote 0
The headers cannot be changed. I added the sheet names but it returned a 0.

If the headers can't be changed, the formulas will be:

Book3.xlsx
ABCDEFGH
1Total PackingTotal ProduceTotal Register
2Matt400
3John1710
4Annie15015
5Sue0012
6MattPacking4
7JohnProduce1
8JohnPacking17
9SueRegister12
10AnniePacking15
11AnnieRegister15
Sheet979
Cell Formulas
RangeFormula
F2:F5F2=SUMIFS($C$6:$C$11,$A$6:$A$11,$E2,$B$6:$B$11,"Packing")
G2:G5G2=SUMIFS($C$6:$C$11,$A$6:$A$11,$E2,$B$6:$B$11,"Produce")
H2:H5H2=SUMIFS($C$6:$C$11,$A$6:$A$11,$E2,$B$6:$B$11,"Register")


But if you're Still getting 0, as Fluff said, your data is Not matching
In an empty cell anywhere, =Sheet4!Bx="Packing", where Bx is a cell you see as "Packing", what's the result?
Also, try the same with A column Names.
and finally, =ISNUMBER(Sheet4!Cx), what's the result?
Also, you might want to do the same check for Sheet1! Name column.
 
Upvote 0
Solution
If the headers can't be changed, the formulas will be:

Book3.xlsx
ABCDEFGH
1Total PackingTotal ProduceTotal Register
2Matt400
3John1710
4Annie15015
5Sue0012
6MattPacking4
7JohnProduce1
8JohnPacking17
9SueRegister12
10AnniePacking15
11AnnieRegister15
Sheet979
Cell Formulas
RangeFormula
F2:F5F2=SUMIFS($C$6:$C$11,$A$6:$A$11,$E2,$B$6:$B$11,"Packing")
G2:G5G2=SUMIFS($C$6:$C$11,$A$6:$A$11,$E2,$B$6:$B$11,"Produce")
H2:H5H2=SUMIFS($C$6:$C$11,$A$6:$A$11,$E2,$B$6:$B$11,"Register")


But if you're Still getting 0, as Fluff said, your data is Not matching
In an empty cell anywhere, =Sheet4!Bx="Packing", where Bx is a cell you see as "Packing", what's the result?
Also, try the same with A column Names.
and finally, =ISNUMBER(Sheet4!Cx), what's the result?
Also, you might want to do the same check for Sheet1! Name column.
I think i got it. I changed JTAKW's formula to be a little more dynamic C:C and A:A etc instead which worked for this smaller test sample. I continue to test on the larger data as soon as I am able. Thanks guys!
 
Upvote 0

Forum statistics

Threads
1,215,463
Messages
6,124,965
Members
449,201
Latest member
Jamil ahmed

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top