Home > Back-end >  Fill a range of cells with a specified value thats divided by another specified value
Fill a range of cells with a specified value thats divided by another specified value

Time:08-13

I have three different inputs, these being 'Flow Demand (Litres)' (amount of fluid needed), 'Number an hour' (number of fluid demands within an hour), and 'time of delivery' (all fluid needs to be despatched within this time, so if demand is 10 litres and time of delivery is 5 minute, then 2 l/m would be needed for 5 minutes).

I effectively want to be able to specify these three values in a cell then have excel auto fill cells which I have set up for each minute within 2 hours.

To give an example I will attach a google sheets link (as excel files can not be) which has what I would like to be shown but without any coding/ formula just as an example. excel sheet

CodePudding user response:

Per my comment on your question, delete minute 60 on the sheet as you're also including minute 0 (min 60 will be min 0 of the next hour). Then, in cell B6 type the formula

=IF(MOD(A6, ROUNDDOWN(60/$B$2, 0))<$B$3, $B$1/$B$3, 0)

A Warning; This formula first checks whether a given minute should have flow or not, then checks what the flow rate for demands is. If Number of Demands x Delivery time is more than 60 this will not work, because demands will overlap and some minutes will have to be at double the calculated flow rate.

  • Related