Forum Discussion
Jonsen625
Sep 20, 2022Copper Contributor
Help with formula
I am looking for help in designing a formula to work out how much product has been produced at a certain time, my factory produces (x) units of product (A) between (timeA) and (timeB), and (x) u...
DexterG_III
Sep 20, 2022Iron Contributor
The formula below will return both the product name and quantity produced if the time entered in A1 is between Time A & Time B. Note this comes with the assumption that if time B is < time A then it must be the next day and is handled by this portion of the formula:
(A1<=IF(B3:B8<A3:A8,B3:B8+1,B3:B8)).
I'm not sure if this is what you are after, but hope it gets you started.
=FILTER(C3:D8,(A1>=A3:A8)*(A1<=IF(B3:B8<A3:A8,B3:B8+1,B3:B8)))
Here's the formula in action: