Range that auto-adjusts depending on Value in Column C and D

JohnTester

New Member
Joined
Sep 25, 2018
Messages
9
Hello Ex-perts.

What the sheet must do.
In column B the number of eggs laid is counted. Once 4+ eggs are laid then the number of days is counted down from 24 in column E.
Should there be a hatchling then the formula should reset for the next 4+ and the count down started over.

I have the first set done but as soon as I re-enter new eggs laid it doesn't calculate at all.
Formula used in E is - =IF(SUM($D$5:D8)=0,IF(SUM($C$5:C8)>=4,$H$1-F7,0),0)
Formula used in F is - =IF(SUM($C$5:C8)>=4,1+F7)

The value of H1 is 24 (days)

As indicated by the yellow line. The total amount after the last 4 eggs has not been registered as a total of 4 to restart the formula.
What I need is something that will automatically re-adjust the range based on the last cell that contained a value both in C and D, respectively Or a macro.
 

Attachments

  • Birds Draft.png
    Birds Draft.png
    45.4 KB · Views: 12

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Here is the XL2BB.

The range should have adjusted to pick up the new value of 4 in column C.

Cell Formulas
RangeFormula
A1A1=MID(CELL("filename",B3),FIND("]",CELL("filename",B3))+1,31)
C5C5=IF('[1. January Breeding.xlsx]Hok1'!$F$36<=0," ",'[1. January Breeding.xlsx]Hok1'!$C$37)
D5D5='[1. January Breeding.xlsx]Hok1'!$D$37
E5E5=IF(E6-1<=0,0,E6+1)
F5F5=IF('[1. January Breeding.xlsx]Hok1'!$F$36<=0,0,'[1. January Breeding.xlsx]Hok1'!$F$36)
E6:E36E6=IF(SUM($D$5:D6)=0,IF(SUM($C$5:C6)>=4,$H$1-F5,0),0)
F6:F36F6=IF(SUM($C$5:C6)>=4,1+F5)
A5A5='Over View'!C42-1
A6A6='Over View'!C42
A7:A36A7=A6+1
C37:D37C37=SUM(C6:C36)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
G5,D5:E5,A5Expression=OR(WEEKDAY($A$5)=1,WEEKDAY($A$5)=7)textNO
A6:G6Expression=OR(WEEKDAY($A$6)=1,WEEKDAY($A$6)=7)textNO
A36:D36,F36:G36Expression=OR(WEEKDAY($A$15)=1,WEEKDAY($A$15)=7)textNO
A35:G35Expression=OR(WEEKDAY($A$14)=1,WEEKDAY($A$14)=7)textNO
A34:G34Expression=OR(WEEKDAY($A$13)=1,WEEKDAY($A$13)=7)textNO
A33:D33,F33:G33Expression=OR(WEEKDAY($A$19)=1,WEEKDAY($A$19)=7)textNO
A32:D32,F32:G32Expression=OR(WEEKDAY($A$18)=1,WEEKDAY($A$18)=7)textNO
A31:D31,F31:G31Expression=OR(WEEKDAY($A$17)=1,WEEKDAY($A$17)=7)textNO
A30:D30,F30:G30Expression=OR(WEEKDAY($A$16)=1,WEEKDAY($A$16)=7)textNO
A29:D29,F29:G29Expression=OR(WEEKDAY($A$15)=1,WEEKDAY($A$15)=7)textNO
A28:G28Expression=OR(WEEKDAY($A$14)=1,WEEKDAY($A$14)=7)textNO
A27:G27Expression=OR(WEEKDAY($A$13)=1,WEEKDAY($A$13)=7)textNO
A26:D26,F26:G26Expression=OR(WEEKDAY($A$19)=1,WEEKDAY($A$19)=7)textNO
A25:D25,F25:G25Expression=OR(WEEKDAY($A$18)=1,WEEKDAY($A$18)=7)textNO
A24:D24,F24:G24Expression=OR(WEEKDAY($A$17)=1,WEEKDAY($A$17)=7)textNO
A23:D23,F23:G23Expression=OR(WEEKDAY($A$16)=1,WEEKDAY($A$16)=7)textNO
A22:D22,F22:G22Expression=OR(WEEKDAY($A$15)=1,WEEKDAY($A$15)=7)textNO
A21:G21Expression=OR(WEEKDAY($A$14)=1,WEEKDAY($A$14)=7)textNO
A20:G20Expression=OR(WEEKDAY($A$13)=1,WEEKDAY($A$13)=7)textNO
A19:D19,F19:G19Expression=OR(WEEKDAY($A$19)=1,WEEKDAY($A$19)=7)textNO
A18:D18,F18:G18Expression=OR(WEEKDAY($A$18)=1,WEEKDAY($A$18)=7)textNO
A17:D17,F17:G17Expression=OR(WEEKDAY($A$17)=1,WEEKDAY($A$17)=7)textNO
A16:D16,F16:G16Expression=OR(WEEKDAY($A$16)=1,WEEKDAY($A$16)=7)textNO
A15:D15,F15:G15Expression=OR(WEEKDAY($A$15)=1,WEEKDAY($A$15)=7)textNO
A14:G14Expression=OR(WEEKDAY($A$14)=1,WEEKDAY($A$14)=7)textNO
A13:G13Expression=OR(WEEKDAY($A$13)=1,WEEKDAY($A$13)=7)textNO
A12:D12,F12:G12Expression=OR(WEEKDAY($A$12)=1,WEEKDAY($A$12)=7)textNO
A11:D11,F11:G11Expression=OR(WEEKDAY($A$11)=1,WEEKDAY($A$11)=7)textNO
A10:D10,F10:G10Expression=OR(WEEKDAY($A$10)=1,WEEKDAY($A$10)=7)textNO
A9:D9,F9:G9Expression=OR(WEEKDAY($A$9)=1,WEEKDAY($A$9)=7)textNO
A8:D8,F8:G8Expression=OR(WEEKDAY($A$9)=1,WEEKDAY($A$9)=7)textNO
A7:G7Expression=OR(WEEKDAY($A$7)=1,WEEKDAY($A$7)=7)textNO
A6:G6Expression=OR(WEEKDAY($A$6)=1,WEEKDAY($A$6)=7)textNO
 
Upvote 0
No help is needed. Sorted it out with the Max formula.
eg. IF((MAX($E$5:E8)-MAX($F$5:F8))<0,0,(MAX($E$5:E8)-MAX($F$5:F8)))
 
Upvote 0
Solution

Forum statistics

Threads
1,214,589
Messages
6,120,416
Members
448,960
Latest member
AKSMITH

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