Calculating required quantities dependent on date

ozbeachbum

Board Regular
Joined
Jun 3, 2015
Messages
159
Office Version
  1. 2021
Platform
  1. Windows
dy calculation.xlsx
BCDEFGHIJKLM
2QuartersPercentageO QtyDateDVUVDateQtyDateQtyDateQty
3
41st Quarter:0.20%100022/07/1999$ 40$ 2012/07/199910011/07/19995010/07/199925
52nd Quarter:
63rd Quarter:
74th Quarter:
Sheet1
Cell Formulas
RangeFormula
C4C4=IF(E4>H4,(F4/(G4*D4)),IF(E4<H4,((F4/(G4*(D4+I4)))),0))


Hi all,
C4 needs to show the result: IF(E4>H4&orJ4&orL4,(F4/(D4 [+quantities in I4 & K4 where dates in H4 & J4 are less than E4][-quantity in M when date in L4 is less than E4] *G4))
It becomes more complex in the second quarter as the formula will need to also calculate any quantities where the dates on row 4 are greater then the date in E4,
along with calculation for row 5 same as row 4
I have tried numerous formulas, but can't get past using only 2 dates as shown in C4
Any assistance would be greatly appreciated.
Cheers,
Dave.
 

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.
For your cell C4 the formula is
Excel Formula:
=F4/((IF(H4<E4,I4,0)+IF(J4<E4,K4,0)-IF(L4<H4,M4,0))*G4)

You see: it is easier to first add (and substract) each of the quantities based on the dates, and only then do the multiplication and division.

You could also have added an extra cell at the end (N4) called Qty Change with the formula
Excel Formula:
=IF(H4<E4,I4,0)+IF(J4<E4,K4,0)-IF(L4<H4,M4,0)
and then refer to that in C4 with
Excel Formula:
=F4/(N4)*G4)

I don't understand your comment about Q2 calculation. Try to explain it in another way
 
Upvote 0
For your cell C4 the formula is
Excel Formula:
=F4/((IF(H4<E4,I4,0)+IF(J4<E4,K4,0)-IF(L4<H4,M4,0))*G4)

You see: it is easier to first add (and substract) each of the quantities based on the dates, and only then do the multiplication and division.

You could also have added an extra cell at the end (N4) called Qty Change with the formula
Excel Formula:
=IF(H4<E4,I4,0)+IF(J4<E4,K4,0)-IF(L4<H4,M4,0)
and then refer to that in C4 with
Excel Formula:
=F4/(N4)*G4)

I don't understand your comment about Q2 calculation. Try to explain it in another way
Thank you that is very helpful.
Q2 I can work this out based on what you have given me.
Thanks again.
Dave.
 
Upvote 0

Forum statistics

Threads
1,214,963
Messages
6,122,484
Members
449,088
Latest member
Melvetica

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