Getting values through index match but ignoring header and blank cells

justme101

Board Regular
Joined
Nov 18, 2017
Messages
67
Office Version
  1. 365
Platform
  1. Windows
Hello all,

I am trying to get values from sheet 2 to sheet 1, using index match, but the problem is that it is simply getting the value form 1st match, which might be blank and I do not need it. I am proving a sample of the sheet data below (sorry, can't post the excel file at the moment):

sht2.jpg


This is how the sheet 1 destination should look like based on where the X's are put in the grid in Sheet 2. The difference between these sheets is that Invoice and retail are in columns in sheet 2 but are pulled into rows in sheet 1. Should be a pretty clear example, but please let me know if this needs explanation.

sht1.jpg
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Here would be one way:

=SUMIFS(INDEX(Sheet2!$C$6:$D$1000,,MATCH($C6,Sheet2!$C$5:$D$5,0)),Sheet2!$A$6:$A$1000,$A6,Sheet2!$B$6:$B$1000,$B6,INDEX(Sheet2!$E$6:$H$1000,,MATCH(D$5,Sheet2!$E$5:$H$5,0)),"x")
 
Upvote 0
Here would be one way:

=SUMIFS(INDEX(Sheet2!$C$6:$D$1000,,MATCH($C6,Sheet2!$C$5:$D$5,0)),Sheet2!$A$6:$A$1000,$A6,Sheet2!$B$6:$B$1000,$B6,INDEX(Sheet2!$E$6:$H$1000,,MATCH(D$5,Sheet2!$E$5:$H$5,0)),"x")

This worked flawlessly on the sample data. Unfortunately, I modified the formula to be applied to the actual data sheet, and it did not work and I ain't smart enough to figure out the exact problem. I used the evaluate formula option as well to see where it went wrong, but it was not clear and suddenly I got the #Value error. I am modifying the sample data a little bit, to match the real one as close as possible. Basically, I am removing the Key column as it was something created by me for Vlookups. Kindly help me with an updated formula, if needed.

SOURCE:
sht22.jpg


DESTINATION:
sht11.jpg
 
Upvote 0

Forum statistics

Threads
1,223,231
Messages
6,170,884
Members
452,364
Latest member
springate

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