Dynamic INDEX/MATCH-function with 2 value-identities

deadlyjack

New Member
Joined
Aug 21, 2021
Messages
23
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
The names of the products on the picture is NOT our products. I've made a look alike theme, with made up names, picturing the question I'd like help with.

I need to purchase tons of flavours/month in order to keep production afloat, amongst many other products.

The flavours are a big aspect to the planning. If you examine, pic 2, you'll see that there are many rows with the same material ArtNr. These all have different approved delivery dates. To make it easier on my behalf, I also added, Week, in column L, just so that I can sort out which week number the different orders will arrive, =ISOWEEKNUM(I2).

pic 1 displays an empty Forecast that I'd like to automate the Order Quantity (Column G in pic 2)

If I try this formula in sheet, Powder, on D3, I'll get the results perfect:

=IFERROR(INDEX('Orders'!$D:$G;SMALL(IF('Orders'!$D:$D=Powder!$B$3;ROW('Orders'!$L:L));ROW(1:1));4);"")
Result: 503 for week 41

But How do I make this dynamic (to the right), where the formula detects both the SKU Nr & Weeknr (Column D & L in sheet, Orders) between C3:O10 in sheet, Powder? I guess that I would need to convert the weeknumbers row in pic 2, to find the right cell for the weeknumbers column in pic 1 🤔

I need the kilo amount for each weeknr in order to plan production ahead of time.

pic 1 (Sheetname = Powder)

2022-10-07_12-05-28-60a88c38618a3a6f4c730f546e32d48d.png


pic 2 (Sheetname = Orders)

2022-10-07_12-05-28-75ebf86d40feeb5713c94cf7683d6218.png

We've been adding the numbers manually & I really would like this particular issue to work by itself 😊
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
In Powder!C3: =SUMIFS(Orders!G:G,Orders!D:D,$B3,Orders!L:L,C$2) Drag it down and to the right.

It should work assuming the Order Quantity column are actually numbers with 'Kg' added via formatting. If the Order Quantity column is full of text that's tough to sum.
 
Upvote 0
When I try your suggestion, I get the result back as 0 & it doesn't seem to be a dynamic solution,. According to the sheet kg is cell formatted:
Suggested solution.png


My current solution is based on a dynamic idea for dragging downwards, see example, selected cell is D3 while draged down the formula:
Current Solution.png


the numbers in D4 & D5 is the rest of the values for N1005783, Row 3, but the weeknumbers with blank value doesn't add between each week + I need the numbers to be added to the right, not downwards... That's why I was hoping one could combined SKU Nr & weeknumber to find it's right position in my forecasting-table.
 
Upvote 0
Oops. I failed to lock the column references to the Orders tab. Enter the formula into C2:

C2: =SUMIFS(Orders!$G:$G,Orders!$D:$D,$B3,Orders!$L:$L,C$2

Drag it to the right to Week 41, and then drag it down in just that column as a test.
 
Upvote 0
Hmm... I receive zeros, could be the KG in the cells... Ionno...
Selected cell is D3.
1665165913920.png


But I'll try to use this formula the best I can!
Thanks!
 

Attachments

  • 1665165868834.png
    1665165868834.png
    22.7 KB · Views: 19
Upvote 0
Thanks it worked nicely!
I just added a bit of coding, since I don't want the 0's to pop up everywhere:

=IF(SUMIFS(Orders!$G:$G,Orders!$D:$D,$B3,Orders!$L:$L,C$2);SUMIFS(Orders!$G:$G,Orders!$D:$D,$B3,Orders!$L:$L,C$2);"")

Changed columns accordingly within the formula, so all of the weekly schedule is in order 😉

Thanks for the help!
 
Upvote 0
I just added a bit of coding, since I don't want the 0's to pop up everywhere:

=IF(SUMIFS(Orders!$G:$G,Orders!$D:$D,$B3,Orders!$L:$L,C$2);SUMIFS(Orders!$G:$G,Orders!$D:$D,$B3,Orders!$L:$L,C$2);"")
If you are using your 365 version then you can do that more efficiently like this (with ; separators instead of commas?)
It is not only shorter, but also saves Excel doing the same calculation twice if not zero. :)

Excel Formula:
=LET(s,SUMIFS(Orders!$G:$G,Orders!$D:$D,$B3,Orders!$L:$L,C$2),IF(s,s,""))
 
Upvote 0
Solution
Amazing! This is exactly what I wanted & it works perfectly!
Since my workbook will be loaded with major tasks, I need the algorithm that requires the least memory access (mems).

Yeah, I need the ; instead of the commas 😉 but is easy to change!
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,326
Members
452,635
Latest member
laura12345

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