Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Formula required for milk production regime

Month Herd Size New Additions in Herd


Milk Production/cow

(Litres)

Total Milk Production

(litres)

Jan

10 10 100
Feb 20 10 10 + 10 100+100
April 20 0 8 + 10 80+100
May 20 0 5 + 10 50+100
June 20 0 2 + 10 20+100
July 40 20 1+8+10 10+80+200

Hello,

I want to make cash flow for dairy farm, as you may know as the time passes the milk production of the cows gradually decreases. As you can see in the table above I have selected the text colour for every new purchase of cow come in the farm. Till now I have manually put the milk produced per cow for every new herd can somebody please help me to make a formula so I do not have to manually decrease the milk production. I just put the new herd size and total milk production automatically calculated in the last column for the next 5 months. thanks 🙂


Further Explanation of the table:

First purchase of 10 cows give 10 litres/cow milk for 2 months then they decrease it to 5 litre/cow in the third month. Every new addition in the herd will follow the same pattern.


Apple Numbers 3.5.2.

MacBook Air, OS X Yosemite (10.10.2)

Posted on Feb 7, 2015 2:01 PM

Reply
20 replies

Feb 25, 2015 9:41 PM in response to Aqeel Chaudhry

Hello


The simplest way I can think of to let cows be retired from herd early and reflect the change to the estimation is to build a Herd table which records date joined and date left for each cow and calculate the number of cows of the i'th month in herd at any given time based upon the Herd table.


Here's an example tables built in Numbers v2.


User uploaded file


Estimation (excerpt) A1 month A2 2015-01-01 A3 2015-02-01 B1 reference date B2 =EOMONTH(A2,-1)+15 B3 =EOMONTH(A3,-1)+15 C1 cows 1 mo C2 =COUNTIFS(Herd::$B,"<="&EDATE($B2,3-COLUMN()),Herd::$B,">"&EDATE($B2,2-COLUMN()),Herd::$C,">"&$B2) C3 =COUNTIFS(Herd::$B,"<="&EDATE($B3,3-COLUMN()),Herd::$B,">"&EDATE($B3,2-COLUMN()),Herd::$C,">"&$B3) D1 cows 2 mo D2 =COUNTIFS(Herd::$B,"<="&EDATE($B2,3-COLUMN()),Herd::$B,">"&EDATE($B2,2-COLUMN()),Herd::$C,">"&$B2) D3 =COUNTIFS(Herd::$B,"<="&EDATE($B3,3-COLUMN()),Herd::$B,">"&EDATE($B3,2-COLUMN()),Herd::$C,">"&$B3) E1 cows 3 mo E2 =COUNTIFS(Herd::$B,"<="&EDATE($B2,3-COLUMN()),Herd::$B,">"&EDATE($B2,2-COLUMN()),Herd::$C,">"&$B2) E3 =COUNTIFS(Herd::$B,"<="&EDATE($B3,3-COLUMN()),Herd::$B,">"&EDATE($B3,2-COLUMN()),Herd::$C,">"&$B3) F1 cows 4 mo F2 =COUNTIFS(Herd::$B,"<="&EDATE($B2,3-COLUMN()),Herd::$B,">"&EDATE($B2,2-COLUMN()),Herd::$C,">"&$B2) F3 =COUNTIFS(Herd::$B,"<="&EDATE($B3,3-COLUMN()),Herd::$B,">"&EDATE($B3,2-COLUMN()),Herd::$C,">"&$B3) G1 cows 5 mo G2 =COUNTIFS(Herd::$B,"<="&EDATE($B2,3-COLUMN()),Herd::$B,">"&EDATE($B2,2-COLUMN()),Herd::$C,">"&$B2) G3 =COUNTIFS(Herd::$B,"<="&EDATE($B3,3-COLUMN()),Herd::$B,">"&EDATE($B3,2-COLUMN()),Herd::$C,">"&$B3) H1 cows 6 mo H2 =COUNTIFS(Herd::$B,"<="&EDATE($B2,3-COLUMN()),Herd::$B,">"&EDATE($B2,2-COLUMN()),Herd::$C,">"&$B2) H3 =COUNTIFS(Herd::$B,"<="&EDATE($B3,3-COLUMN()),Herd::$B,">"&EDATE($B3,2-COLUMN()),Herd::$C,">"&$B3) I1 herd size I2 =SUM(C2:H2) I3 =SUM(C3:H3) J1 total litres J2 =SUMPRODUCT(C2:H2,Litres::B$2:G$2) J3 =SUMPRODUCT(C3:H3,Litres::B$2:G$2) K1 litres/cow K2 =J2/I2 K3 =J3/I3



Notes.


The formula in C2 can be filled down and right across C2:H13.


C2 is calculating the number of cows of the 1st month in herd at the time of reference date = 2015-01-15 by means of COUNTIFS() counting cows in Herd table where 2014-12-15 < [date joined] <= 2015-01-15 and [date left] > 2015-01-15.


D2 is calculating the number of cows of the 2nd month in herd at the time of reference date = 2015-01-15 by means of COUNTIFS() counting cows in Herd table where 2014-11-15 < [date joined] <= 2014-12-15 and [date left] > 2015-01-15.


And so on.



Good luck,

H


EDIT: replaced the screen shot with correct one.

Formula required for milk production regime

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.