ExcelAtEverything
Active Member
- Joined
- Jan 30, 2021
- Messages
- 351
- Office Version
- 2019
- Platform
- Windows
Ok, this may be a lot of text, but it shouldn't be THAT complicated of a problem. I just want to be sure I'm thorough in my explanation.
Below is a mocked up version of something I'm having a problem with. Imagine that the below range is a Power Pivot Table, which has additional sales numbers added to it as each day passes (via Power Query). The dates in row 3 will always ne Jan-December of the current year, and the categories in column B will pretty much always be the same. Also note that each date has 3 sections (delivery, in-store, and pickup). I've collapsed a bunch of columns just to show that these are not short rows of info. There are 3 columns for each day of the year.
Additionally, there is a Date cell in different sheet in this workbook which shows the date that the reporting should be looking at (the date is manually input by the user into that cell). For the sake of this formula that I'm asking for help with, let's refer to that date as Details!G$3 and assume that the date in it right now is 5/31/2021.
So what I need is a formula to place into my "In-Store Totals" column (not seen below) which will check the date (located at Details!$G$3, showing 5/31/2021), and as a result will return the word "Fish" because the number "8883" is the highest number in the 5/31/2021 "In-Store" column. The formula needs to be done in such a way that it allows for the category to change from day to day. In other words if I decide to look at 5/31's "Delivery" column, then the correct return would be "Bread", because the largest number is 1023.
Unless I'm mistaken this will work better as an Index/Match formula. I just can't get it to work correctly. As part of my Index/Match, I was using LARGE(MaxCat!BH5:BH13,1) to get the 8883, but I kept erroring out when I tried to use in conjunction with the MATCH function. Here is the gist of what I'm looking for, but this of course does not work.
=INDEX($B$3:$FN$13,
MATCH(LARGE(MaxCat!BH5:BH13,1),BH5:BH13,0),
MATCH(Details!G$3,$B$3:$FN$13,0))
Thanks for any help.
Below is a mocked up version of something I'm having a problem with. Imagine that the below range is a Power Pivot Table, which has additional sales numbers added to it as each day passes (via Power Query). The dates in row 3 will always ne Jan-December of the current year, and the categories in column B will pretty much always be the same. Also note that each date has 3 sections (delivery, in-store, and pickup). I've collapsed a bunch of columns just to show that these are not short rows of info. There are 3 columns for each day of the year.
Additionally, there is a Date cell in different sheet in this workbook which shows the date that the reporting should be looking at (the date is manually input by the user into that cell). For the sake of this formula that I'm asking for help with, let's refer to that date as Details!G$3 and assume that the date in it right now is 5/31/2021.
So what I need is a formula to place into my "In-Store Totals" column (not seen below) which will check the date (located at Details!$G$3, showing 5/31/2021), and as a result will return the word "Fish" because the number "8883" is the highest number in the 5/31/2021 "In-Store" column. The formula needs to be done in such a way that it allows for the category to change from day to day. In other words if I decide to look at 5/31's "Delivery" column, then the correct return would be "Bread", because the largest number is 1023.
Unless I'm mistaken this will work better as an Index/Match formula. I just can't get it to work correctly. As part of my Index/Match, I was using LARGE(MaxCat!BH5:BH13,1) to get the 8883, but I kept erroring out when I tried to use in conjunction with the MATCH function. Here is the gist of what I'm looking for, but this of course does not work.
=INDEX($B$3:$FN$13,
MATCH(LARGE(MaxCat!BH5:BH13,1),BH5:BH13,0),
MATCH(Details!G$3,$B$3:$FN$13,0))
Thanks for any help.