if function

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Need Help! I need a simple solution to a simple problem but can't remember
how to resolve this formula (i've not done formulas for 3 years- yikes!)
Basically I need to identify if a person is "hourly", they receive "8" hours
of vacation, if they are "salary", then they receive 16 hours of vacation. I
don't know what would be the best way to resolve this. I used
=if(A1="hourly",8,0).... but I could not remember how to check the cell for
more than one "text" and give me a result based on the cell contents.
A B
1 hourly 8 (result)
2 salary 16 (result)

Can anyone help me with this thing?
 
Hi!

If the cell can only have 2 possible values, either hourly or salary:

=IF(A1="hourly",8,16)

But that's not very robust. If A1 was empty or ANY value other than hourly
the formula would still return 16. So, you should probably explicitly test
for each possible value:

=IF(A1="hourly",8,IF(A1="Salary",16,"")

If A1 is any value other than hourly or salary the formula returns a blank.

Biff
 
Biff, Hello. Thank you! I knew it was simple. I couldn't seem to remember
how to view the result I needed. Once again, THANKS!!!
karenYM
 
You're welcome. Thanks for the feedback!

Biff

KarenYM said:
Biff, Hello. Thank you! I knew it was simple. I couldn't seem to
remember
how to view the result I needed. Once again, THANKS!!!
karenYM
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top