IF Macro / Function

K

Kimmon

PLEASE help, I need to create a Macro urgent and don't know how:

QUESTION:

If cell x <5 or >10 x = 0.5
If cell x >10 x = 1

My attempt:

=IF(B1<5,"0.5",IF(B1>10,"0.5",IF(B1>10,"1")))

It doesn't look right?
 
K

kimmon

Sorry, it is meant to say

If cell x >5 or <10 x = 0.5
If cell x >10 x = 1

It is to be used to calculate lunch hours, employees working more than 5hrs
but less than 10hrs get 1/2 hr lunch, but employees working longer than 10hrs
get 1hr lunch.
 
X

xlm

try this

=IF(B2<=5,0.5,IF(B2>=10,1))

Does this do what you want?
--

Thank You

cheers,

========================
please click the Yes button if this help
========================
 
K

kimmon

Hi, thank you but no not really. I need either 0.5 or 1 as an answer, not
true or false?
 
X

xlm

I post before you have change your criteria.

ok try this

=IF(AND(D15>=200,D15<=300),0.5,IF(D15>300,1,"not in criteria"))

change the range and the message to suit yours.

HTH
--

Thank You

cheers,

========================
please click the Yes button if this help
========================
 

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

Top