VLOOKUP based on 2 headers of a single column (perhaps Index/Match is better)

Bjomesphat

New Member
Joined
Jun 7, 2022
Messages
6
Office Version
  1. 365
Platform
  1. Windows
I'm trying to do a vlookup (or an index/match if those functions are better suited), to find values based on the matching date, as well as 2 headers on a single column, and then I need to sum the returned values.

The challenge I'm running into, is that I need to pull the data that matches the same date, but it can only be from columns with PHX and I need to sum the value from these two SKUs: 12383 and 12386. Keep in mind, columns with BVL have these same SKU numbers, hence why I need to be able to differentiate between BVL and PHX columns.

I was able to do it one way with vlookup, but it depends on my columns always being in the exact same location, but I can't always guarantee that. This is that formula:
=IFNA(SUMPRODUCT(VLOOKUP(B$5,Actual!$A$3:$J$7,{7,10},FALSE)),0)

Here is the table I'm trying to fill in values for:
test file.xlsx
ABCDEFGH
4PHXSundayMondayTuesdayWednesdayThursdayFridaySaturday
511/13/202211/14/202211/15/202211/16/202211/17/202211/18/202211/19/2022
6Forecast477,036240,729226,519243,000217,078206,004235,310
7Actual396,895
Sheet1
Cell Formulas
RangeFormula
B7B7=IFNA(SUMPRODUCT(VLOOKUP(B$5,Actual!$A$3:$J$7,{7,10},FALSE)),0)


And here is the data I'm pulling from on a separate sheet:
test file.xlsx
ABCDEFGHIJ
1BVLBVLBVLBVLPHXPHXPHXPHXPHX
2Date/SKU12383123841238512386510312383123841238512386
311/13/2022118686052703163842415713933202516661394664870
411/14/202278499937496107661525382126720313572373548008
511/15/20226914964297910670146355222075912639171537025
611/16/20226920213689810420126486132153539301290139365
711/17/2022571972273398291112066221964779585289044080
Actual


Appreciate any and all help.
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
See if this does what you want.

Bjomesphat.xlsm
ABCDEFGH
4PHXSundayMondayTuesdayWednesdayThursdayFridaySaturday
513/11/202214/11/202215/11/202216/11/202217/11/202218/11/202219/11/2022
6Forecast
7Actual396,895315,211244,616254,718240,55700
Sheet1
Cell Formulas
RangeFormula
B7:H7B7=SUM(FILTER(FILTER(Actual!$B3:$J7,(Actual!$B1:$J1=$A4)*((Actual!$B2:$J2=12383)+(Actual!$B2:$J2=12386)),0),Actual!$A3:$A7=B5,0))
 
Upvote 0
Solution
You're welcome. Thanks for the follow-up. :)
 
Upvote 0

Forum statistics

Threads
1,214,826
Messages
6,121,795
Members
449,048
Latest member
greyangel23

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