Formula help

joercav

New Member
Joined
Feb 14, 2022
Messages
8
Platform
  1. MacOS
Farm spreadsheet. Struggling with a formula. Any help would be appreciated.
I have a sheet that lists daily livestock nutrition needs with start and end dates. The list is long and has overlapping ranges. On another sheet I would like to summarize the quantity of nutrition needed for a given period, for example monthly.

The formula I need would be on the second sheet and would multiply the number of days of each row on the first sheet that occur in the specified date range, with the quantity of nutrition needed and then sum all of those quantities together.

I simplified the sheets to show an example.

Truly appreciative for any help. I’ve put a stupid number of hours on this and haven’t made any progress. Only solutions I’ve come up with are incredibly clunky.

5EB8BC45-4009-40AE-8950-B7F44CE2779A.jpeg
5CBD4CD8-0E6C-441C-80E6-ED7130D38A1B.jpeg
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
My mac is at home, and I hope you have a later version of excel...

MrExcelPlayground6.xlsx
ABCDEFGHIJKLMNOPQR
1StartEndTDN/dayCP/dayTDNCP
211/18/202112/16/202119623034/1/20224/30/202269253107181341354/1/202212/16/20210069253
34/7/20225/5/202230114665/1/20225/31/20223161551864-6-54/7/20224/30/20222369253
47/17/20228/14/202243836786/1/20226/30/202200-107-1067/17/20224/30/202200
511/24/202212/22/202235615517/1/20227/31/2022613629492-237-23611/24/20224/30/202200
63/2/20233/30/202329384548/1/20228/31/202216304768814-335-3343/2/20234/30/202200
76/1/20236/29/202333505189/1/20229/30/202200-426-4256/1/20234/30/202200
87/11/20238/8/20233533546-466-4657/11/20234/30/202200
98/8/20239/5/20233066474-494-4938/8/20234/30/202200
1010/17/202311/14/20232719420-564-56310/17/20234/30/202200
1112/1/202312/29/20232468382-609-60812/1/20234/30/202200
Sheet32
Cell Formulas
RangeFormula
I2:I7I2=EOMONTH(H2,0)
J2:J7J2=SUM(IF(IF((H2-$A$2:$A$11)>0,$B$2:$B$11,I2)-IF((H2-$A$2:$A$11)>0,H2,$A$2:$A$11)>0,IF((H2-$A$2:$A$11)>0,B2:B11,I2)-IF((H2-$A$2:$A$11)>0,H2,$A$2:$A$11),0)*$C$2:$C$11)
K2:K7K2=SUM(IF(IF((H2-$A$2:$A$11)>0,$B$2:$B$11,I2)-IF((H2-$A$2:$A$11)>0,H2,$A$2:$A$11)>0,IF((H2-$A$2:$A$11)>0,$B$2:$B$11,I2)-IF((H2-$A$2:$A$11)>0,H2,$A$2:$A$11),0)*$D$2:$D$11)
L2:L11L2=(H2-$A$2:$A$11)
M2:M11M2=I2-$B$2:$B$11
N2:N11N2=IF(L2#>0,H2,A2:A11)
O2:O11O2=IF(L2#>0,B2:B11,I2)
P2:P11P2=IF(O2#-N2#>0,O2#-N2#,0)
Q2:Q11Q2=P2#*C2:C11
R2R2=SUM(Q2#)
H3:H7H3=I2+1
Dynamic array formulas.


The solution is in columns J and K. But that is mostly incomprehensible, so I've included L-R to show the breakdown of the calculations.
 
Upvote 0
Thanks for the help! For some reason I’m not able to duplicate the formula on my computer. Probably the wrong version. Appreciate the assist anyways, helped me figure out an alternative.
 
Upvote 0

Forum statistics

Threads
1,214,827
Messages
6,121,818
Members
449,049
Latest member
cybersurfer5000

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