Fun inventory problem

excelhjalp

New Member
Joined
Aug 7, 2018
Messages
33
Office Version
  1. 365
Platform
  1. Windows
Hello!

I have a problem I can't seem to solve. This is for a rental busniess that rents out products and gets them back at a certain date.
I have four tables.

Table A: A daterange based on ID, that's a key between table A and table B
Table B: A table where one or more products can be reserved as well as how many of them. Each ID can be made of multiple products here.
Table C: An Inventory based on dates. Here a formula would be needed for the third column, inventory. It should calculate how many products are available at a given date based on Table A, B and D. It should take the total count of products from table D, and subtract the total number reserved in tables A and B and give a result, for each day specified.
Table D: A simple table where the total number of products is stated.

So the problem is: What formula can I use to calculate total products of each type in stock at a given date in the third column in Table C?

Thanks for those who give this a shot! :D

masterskjal2.3.xlsb.xlsx
ABCDEFGHIJKLMNOPQR
1Table ATable BTable CTable D (Total inventory)
2IDDate fromDate toIDProductCount of productProductDateInventoryFootball3
311.1.20222.1.20221Football2Football1.1.20221Pants5
421.1.20223.1.20221Chair2Football2.1.20223Chair10
533.1.20224.1.20222Pants3Football3.1.20223
63Chair6Football4.1.20223
7Football5.1.20223
8Pants1.1.20225
9Pants2.1.20222
10Pants3.1.20222
11Pants4.1.20225
12Pants5.1.20225
13Chair1.1.20228
14Chair2.1.20228
15Chair3.1.20226
16Chair4.1.20226
17Chair5.1.202210
18
19
20
21
Sheet1
 
How about
Excel Formula:
=VLOOKUP(K3,$Q$2:$R$4,2,0)-FILTER($H$3:$H$6,ISNUMBER(MATCH($F$3:$F$6,FILTER($A$3:$A$5,($B$3:$B$5<=L3)*($C$3:$C$5>=L3),0),0))*($G$3:$G$6=K3),0)
Amazing! This works! Thanks a lot Fluff!
 
Upvote 0

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Glad we could help & thanks for the feedback.
 
Upvote 0
How about
Excel Formula:
=VLOOKUP(K3,$Q$2:$R$4,2,0)-FILTER($H$3:$H$6,ISNUMBER(MATCH($F$3:$F$6,FILTER($A$3:$A$5,($B$3:$B$5<=L3)*($C$3:$C$5>=L3),0),0))*($G$3:$G$6=K3),0)
Hi! What about a non-365 solution? I wonder what I did wrong :/
 
Upvote 0
With your formula, for Chair the Index part will return an ID of 1 & so will never look at ID 3.
 
Upvote 0

Forum statistics

Threads
1,224,737
Messages
6,180,670
Members
452,993
Latest member
FDARYABEE

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