Forum Discussion
Excel Formula, combining two IF statements
MarieHelena , you are welcome
I need a help with two if function in one cell.
I must take details from two sheet, and for that reason, use one if function. Another if function I need for keep clear cell with error example #N\A
=if(a4="","") =if(g4="crew",""),if(g4="pax",vlookup(a4,pax!a:u, 5,false))
I must prepare functions in whole sheet but if I don't type argument in cells always show error msg #N\A
Thanks,
Sinisa
- SergeiBaklanOct 10, 2021Diamond Contributor
To split on part
years 5 to year 8,
year 3 to years 5
years 1 to 3
with nested IF could be done as
=IF( B7 >= 8, calculationEight, IF( B7 >= 5, calculationFive, IF( B7 >= 3, calculationThree, IF( B7 >= 1, calculationOne, 0 )))) - Dubai_RedOct 10, 2021Copper Contributor
thanks Sergei.
B7 = years and I have different variables depending on the number of years a person is in employment.
so if a person is in employment for 8 years, the remuneration would be split in different parts for service completed between:
years 5 to year 8,
year 3 to years 5
years 1 to 3.
the first IF function works for anyone who has completed more than 5 years of service as well as anyone who has completed more than 3 years. It’s only when the person has completed less than 3 years I get stuck.
the 2nd IF function works in isolation, but not when combined with the 1st.
- SergeiBaklanOct 10, 2021Diamond Contributor
You current formula has IF() only in it first part
=IF( B7 > 5, (C7+D7+E7)*30/365*(B7-5) ) + (C7+D7+E7/2)*30/365*2 + (C7+D7)*21/365*3If you mean combine second formula with that part it could be
=IF( B7 > 5, (C7+D7+E7)*30/365*(B7-5), IF( B7 > 3, "have no idea what shall be here", (C7+D7)*21/365*B7 )) + (C7+D7+E7/2)*30/365*2 + (C7+D7)*21/365*3It is not defined what shall be returned if B7 is between 3 and 5. With assumption it is second part of your initial formula, it could be
=IF( B7 > 5, (C7+D7+E7)*30/365*(B7-5), IF( B7 > 3, (C7+D7+E7/2)*30/365*2 + (C7+D7)*21/365*3, (C7+D7)*21/365*B7 )) - Dubai_RedOct 10, 2021Copper Contributor
Hi Segei
Can you help me with combining the below two IF statements:
Hi Everyone,
I need to combine two IF statements:
IF(B7>5,(((C7+D7+E7)*30/365))*(B7-5))+((C7+D7+(E7/2))*(30/365)*2)+(((C7+D7))*(21/365)*3)
IF(B7<=3,(C7+D7)*(21/365))*B7
Any suggestions would be highly appreciated.
Thanks
- Sinisa1707Apr 10, 2021Copper Contributorhey Sergei ,
Already fixed. My mistakes was that I had put parenthesis after first argument.
Anyway thanks a lot
Sinisa - SergeiBaklanApr 10, 2021Diamond Contributor
Perhaps you mean
=IF(A4="","", IF(G4="crew","", IF(G4="pax", IFNA(vlookup(a4,pax!a:u, 5,false), "can't find"), "wrong combination" )))