2

I am creating IF statements in Excel to budget according to the discipline of engineers. I want:

IF(H5="CIVIL") then print for me value (I5*5000)
IF(H5="ARCHITECT") then print for me value (I5*3000)
IF(H5="ELECTRIC") then print for me value (I5*3000)
IF(H5="MECHANIC") then print for me value (I5*2000)

I am using a nested IF statement:

 =IF(H5="CIVIL",I5,I5*5000,IF(H5="ARCHITECT",I5,I5*3000,IF(H5="ELECTRIC",I5,I5*3000,IF(H5="MECHANIC",I5,I5*2000))))

but I see the message "You've entered too many arguments for this function".

How can I use the formula without any problem?

3
  • Try this =IF(H5="CIVIL",I5*33000,IF(H5="ARCHITECT",I5*16000,IF(H5="ELECTRIC",I5*12000,IF(H5="MECHANIC",I5*10000)))) Commented Apr 3, 2015 at 11:44
  • In previous time i used that way but not work my function is correct. when i use only CIVIL,ARCHITECT,ELECTRIC AND MECHANIC it is work but when i use two statement not work Commented Apr 3, 2015 at 11:48
  • The logic for nested IFs remains the same in any language you use IF( condition1, value1, IF( condition2, value2)) Commented Apr 3, 2015 at 11:51

3 Answers 3

2

Please try:

=IF(H5="CIVIL",5000,IF(OR(H5="ARCHITECT",H5="ELECTRIC"),3000,2000))*I5
Sign up to request clarification or add additional context in comments.

2 Comments

don't show me the error message but when i use CIVIL or ARCHITECT or ELECTRIC text every time multiple I5 Cell by 2000 and not multiple by 5000 for civil and 3000 for architect
"double inverted commas"
1

There will be more professions with more values, so a "single formula" approach is second best. You should use a table with profession and value, and use VLOOKUP, then you can change values and add professions as you like without updating spaghetti formula code ... e.g.

       A        B
1    Civil    5000
2    Arch     3000
3    Elec     3000
4    Mech     2000

Specifying a profession in H5, you would use the following formula in I5:

=VLOOKUP(H5,A1:B4,2,FALSE)

Looking at your edit ... one more reason NOT to hide the unit cost in a formula, because in 2016 the rates might be different --> use a table!

3 Comments

please help me i don't understand your explain
well ... I just abbreviated ARCHITECT by Arch ... use whatever ... and of course, if you have to multiply the rate found by VLOOKUP based on a profession in H5 with hours specified in -say- I5, you'd say =I5*VLOOKUP(H5, ... ) ... the message here really is to use a table once to specify the rates in one place, and then retrieve the values of that table using VLOOKUP rather than hardcoding important values into formulae.
@pnuts re delimiters ... my bad !! I was able to mentally "translate" the first as I was typing, for the others my (Austrian) autopilot apparently took over ... corrected.
0

You can always open your formula in a text editor and check it. I use line breaks to separate arguments. If you don't comment like I did you can even reimplement the now formatted formula. Saved me a lot of times.
Also, I've found your formula's hiatus:

=IF(
H5="CIVIL",   'test
I5,           'If True
I5*5000,      'If False
IF(           'WAT
H5="ARCHITECT",
I5,I5*3000,IF(H5="ELECTRIC",I5,I5*3000,IF(H5="MECHANIC",I5,I5*2000))))

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.