Code Problems

Status
Not open for further replies.

4 Barrel Harold

New Member
Joined
Jun 15, 2018
Messages
21

Excel 2010 32 bit
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAF
1Main LengthMax Length
250382.0
3
4
5
6
7
8Main LengthSection LengthsTopBottomFinal Result
950e0003820.0
1050d3320003820.0
1150c245003820.0
1250b828045382377.0MAX(0,IF(NOT(OR(H12H12,A12-H12,G12),IF(SUM(G12:G42)>R12,((G12-(G12-R12)-SUM(G13:G40))))))
1350a545503825.0
1450
Sheet1 (2)
Cell Formulas
RangeFormula
A12=IF(OR(ISBLANK(G12)),"",A11)
H12=IF(OR(ISBLANK(G11)),"",MAX(0,IF(NOT(OR(A12G9:G50))),IF(SUM(G13:G50)G12:G50),H11+G11),G11-(SUM(G11:G50)-A11))))
I12=IF(OR(ISBLANK(G12)),"",MAX(0,IF(NOT(OR(A13G10:G51))),IF(SUM(G14:G51)G13:G51),H12+G12),G12-(SUM(G12:G51)-A12))))
R12=IF(OR(ISBLANK(G12)),"",R11)
S12=MAX(0,IF(NOT(OR(H12)),IF(SUM(G12:G42)>H12,A12-H12,G12),IF(SUM(G12:G42)>R12,((G12-(G12-R12)-SUM(G13:G40))))))



Ok I’m by no means a computer programmer, so here is my problem. In this calculation I need the final result total to max out at 382, but if the Main length drops below the Maximum length the final result will not exceed the Main length when totaled, Confused yet ” I AM “ this is why I’m asking the experts LOL I have also included a screenshot of my calculation problem for the bigger picture. Any streamline of this code will be greatly appricated Thank 4-Barrel Harold


I need help with the Formula In Cell S12

=MAX(0,IF(NOT(OR(H12H12,A12-H12,G12),IF(SUM(G12:G42)>R12,((G12-(G12-R12)-SUM(G13:G40))))))
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Please do not post the same question multiple times. All clarifications, follow-ups, and bumps should be posted back to the original thread.
Per forum rules, posts of a duplicate nature will be locked or deleted (rule 12 here: Forum Rules).
 
Upvote 0
Status
Not open for further replies.

Forum statistics

Threads
1,223,896
Messages
6,175,263
Members
452,627
Latest member
KitkatToby

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