ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   if function (https://www.excelbanter.com/excel-discussion-misc-queries/94089-if-function.html)

KarenYM

if function
 
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?

Biff

if function
 
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

"KarenYM" wrote in message
...
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?




KarenYM

if function
 
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


"Biff" wrote:

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

"KarenYM" wrote in message
...
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?





Biff

if function
 
You're welcome. Thanks for the feedback!

Biff

"KarenYM" wrote in message
...
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


"Biff" wrote:

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

"KarenYM" wrote in message
...
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?








All times are GMT +1. The time now is 02:47 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com