combining multiple formulas into one if statement

pile-it Mark

Board Regular
Joined
Jan 10, 2006
Messages
125
Hello!

i am back playing with a status sheet again. had to start a new plane. i am trying to make it less error prone. in the Next Due Column H



Hours =f16+K16
Months =EOMONTH(j16,f16)
Cycles =l16+f16
Days =(J16+f16)
Years =EOMONTH(J16,F16*12)
Ldgs =L16+F16
AC Hours =IF(G131="AC Hours",F131+C$13,"b")

these formulas all work individually, they were taken from cells that i have been testing. but i would like to not have to insert and check 500 lines multiple times.

one formula in H that covers the condition in G.
that shows the calculation combining frequency in F with start in J (date), K (Hours), L (Cycles/Landings) A/C Hobbs in C$13



this works on the first two lines that are "hours" and "months" it does not like Ldgs or years

=IF(G17="Hours",K17+F17,IF(G17="Months",EOMONTH(J17,F17),IF9(G17="Ldgs",L17+F17,IF(G17="Years",EOMONTH(J17,F17*12),IF(G17="Days",J17+F17,IF(G17="AC Hours","fix ME"))))))

just realized i did not include Cycles in the if statement. Ldgs are airframe, Cycles are Engine. not always the same

any thoughts would be appreciated. i actually have the formulas in place now, but the sheet is available to others and if day gets switched to month in a revision,not everyone knows the formula needs changed.

Thanks for looking.
Mark
 

Excel Facts

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

Excel 2010
EFGHIJKLM
16SN or other info FREQUENCYNEXT DUEREMAININGcomplied with
17#REF!DateHourCycleREMAINING
18300Hours9517.1299.47/5/20179217.112540299
1912Months31-Jul-181377/5/20179217.112540137
20600Hours9817.1599.47/5/20179217.112540599
2124Months31-Jul-195027/5/20179217.112540502
221200Hours10417.11199.47/5/20179217.1125401199
2348Months31-Jul-2112337/5/20179217.1125401233
242400Hours11617.12399.47/5/20179217.1125402399
2596Months31-Jul-2526947/5/20179217.1125402694
263000Ldgs6507.0-60335/5/20134309.13507-6033
2712Years31-May-2526335/5/20134309.135072633
286,000Ldgs9507.0-30335/5/20134309.13507-3033
2912,000Hours20800.011582.35/5/20138800.0350711582
TBO r2
 
Upvote 0

Excel 2010
EFGHIJKLM
16SN or other info FREQUENCYNEXT DUEREMAININGcomplied with
17#REF!DateHourCycleREMAINING
18300Hours9517.1299.47/5/20179217.112540299
1912Months31-Jul-181377/5/20179217.112540137
20600Hours9817.1599.47/5/20179217.112540599
2124Months31-Jul-195027/5/20179217.112540502
221200Hours10417.11199.47/5/20179217.1125401199
2348Months31-Jul-2112337/5/20179217.1125401233
242400Hours11617.12399.47/5/20179217.1125402399
2596Months31-Jul-2526947/5/20179217.1125402694
263000Ldgs6507.0-60335/5/20134309.13507-6033
2712Years31-May-2526335/5/20134309.135072633
286,000Ldgs9507.0-30335/5/20134309.13507-3033
2912,000Hours20800.011582.35/5/20138800.0350711582
TBO r2
Cell Formulas
RangeFormula
J19=J18
J21=J20
J23=J22
J25=J24
K19=K18
K21=K20
K23=K22
K25=K24
L19=L18
L21=L20
L23=L22
L25=L24
H17=IF(G17="Hours",K17+F17,IF(G17="Months",EOMONTH(J17,F17),IF9(G17="Ldgs",L17+F17,IF(G17="Years",EOMONTH(J17,F17*12),IF(G17="Days",J17+F17,IF(G17="AC Hours","fix ME"))))))
H18=IF(G18="Hours",K18+F18,IF(G18="Months",EOMONTH(J18,F18),IF10(G18="Ldgs",L18+F18,IF(G18="Years",EOMONTH(J18,F18*12),IF(G18="Days",J19+F18,IF(G18="AC Hours","fix ME"))))))
H19=IF(G19="Hours",K19+F19,IF(G19="Months",EOMONTH(J19,F19),IF11(G19="Ldgs",L19+F19,IF(G19="Years",EOMONTH(J19,F19*12),IF(G19="Days",J20+F19,IF(G19="AC Hours","fix ME"))))))
H20=K20+F20
H21=IF(G21="Hours",K21+F21,IF(G21="Months",EOMONTH(J21,F21),IF13(G21="Ldgs",L21+F21,IF(G21="Years",EOMONTH(J21,F21*12),IF(G21="Days",J22+F21,IF(G21="AC Hours","fix ME"))))))
H22=K22+F22
H23=EOMONTH(J23,F23)
H24=IF(G24="Hours",K24+F24,IF(G24="Months",EOMONTH(J24,F24),IF16(G24="Ldgs",L24+F24,IF(G24="Years",EOMONTH(J24,F24*12),IF(G24="Days",J25+F24,IF(G24="AC Hours","fix ME"))))))
H25=EOMONTH(J25,F25)
H26=L26+F26
H27=EOMONTH(J27,F27*12)
H28=L28+F28
H29=K29+F29
I18=H18-C$7
I19=H19-C$2
I20=H20-C$7
I21=H21-C$2
I22=H22-C$7
I23=H23-C$2
I24=H24-C$7
I25=H25-C$2
I26=H26-C$8
I27=H27-C$2
I28=H28-C$8
I29=H29-C$7
M18=I18
M19=I19
M20=I20
M21=I21
M22=I22
M23=I23
M24=I24
M25=I25
M26=I26
M27=I27
M28=I28
M29=I29


i would like column H to have one formula that uses column G to decide which of the seven current formulas to use.

this is a test area of the working formulas

they have to be put into column H individually and manually checked the make sure they match the frequency of operations

Hours
Months
Cycles
Days
Years
AC Hours
Ldgs



Excel 2010
LM
2Hours9517.1
3Months31-Jul-18
4Cycles6507.0
5Days1-Dec-11
6Years30-Apr-87
7AC Hours822.2
8Ldgs6507.0
TBO r2
Cell Formulas
RangeFormula
M2=F18+K18
M3=EOMONTH(J19,F19)
M4=L26+F26
M5=(F40+J40)
M6=EOMONTH(H27,J27+(F27*12))
M7=IF(G131="AC Hours",C$13+F131)
M8=L26+F26
 
Upvote 0
trying to use the word in G to set the formula in H


Excel 2010
LM
1if G=Use this Formula
2Hours9517.1
3Months31-Jul-42
4Cycles12840.0
5Days1-May-18
6Years31-Oct-02
7AC Hours 
8Ldgs12840.0
9#REF!
TBO r2
Cell Formulas
RangeFormula
M2=F18+K18
M3=EOMONTH(J18,F18)
M4=L18+F18
M5=(F18+J18)
M6=EOMONTH(H18,J18+(F18*12))
M7=IF(G18="AC Hours",C$13+F18," ")
M8=L18+F18
L9=IF(G17="Hours",K17+F17,IF(G17="Months",EOMONTH(J17,F17),IE9(G17+J4,IF(G17="Years",EOMONTH(J17,F17*12),IF(G17="Days",J17+F17,IF(G17="AC Hours","fix ME"))))))



this if statement returns errors

=IF(G18="Hours",K18+F18,IF(G18="Months",EOMONTH(J18,F18),If(G18+J4,IF(G18="Years",EOMONTH(J18,F18*12),IF(G18="Days",J18+F18,IF(G18="AC Hours","fix ME"))))))
 
Upvote 0
found a spelling problem

=IF(G18="Hours",K18+F18,IF(G18="Months",EOMONTH(J18,F18),IF(G18="Ldgs",L18+F18,IF(G18="Years",EOMONTH(J18,F18*12),IF(G18="Days",J19+F18,IF(G18="AC Hours","fix ME"))))))


this seems to work if it is copied and special pasted in H as a formula only.

still need to add cycles and correct the AC Hours answer to match the formula
 
Upvote 0
fixed a number error. in the "days" statement

=IF(G24="Hours",M24+F24,IF(G24="Months",EOMONTH(L24,F24),IF(G24="Ldgs",N24+F24,IF(G24="Cycles",N24+F24,IF(G24="Years",EOMONTH(L24,F24*12),IF(G24="Days",L24+F24,IF(G24="AC Hours",IF(G24="AC Hours",C$13+F24))))))))
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,874
Members
452,363
Latest member
merico17

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