Multiple if statements

V

v1rt8

Need some help again please.
G1 contains a list box, contained in the list box:
OFF 1 2 3 4 5 6 7

N6 will contain the if statements:
If G1=Off will return a statement in cell N6 of OFF
If G1=1 (1-6) will return a statement in cell N6 of WORK
If G1=7 will return a statement in cell N6 of REST 24 HOURS
The following formula does not work:
=if(and(g1="OFF","OFF"),if(g1>0,g1<7,"WORK"),if(g1="7","REST 24 HOURS"))
of course i have tried each number with own if statement but ran into that
proverbial >7 if statements.

Any advice, input would be valuable, thanks in advance.
Doug
 
F

FSt1

hi
try it this way....
=IF(G1="off","off",IF(AND(G1>0,G1<7),"work",IF(G1=7,"Rest 24 Hours",0)))

if G1 contains anything other than Off, 1,2,3,4,5,6 or 7, then the results
will be 0(zero).
adjust the zero to suit.

Regards
FSt1
 
J

JLatham

How about simply:
=IF(G1="Off","OFF",IF(G1=7,"REST 24 HOURS","Work"))

It appears there are really only 3 responses:
OFF when G1="Off"
REST 24 HOURS when G1 is 7
and
"WORK" when G1 =1, 2, 3, 4, 5 or 6
 
V

v1rt8

Thank you FSt1 for the quick and accurate response. Imagine 4 hours on this
and less than 10 minutes it is fixed.
Doug
 
V

v1rt8

JLatham, Thank you for your quick response, I have used your formula and
resolved the issue.
Doug
 
F

FSt1

hi doug
thanks for the feedback.

regards
FSt1

v1rt8 said:
Thank you FSt1 for the quick and accurate response. Imagine 4 hours on this
and less than 10 minutes it is fixed.
Doug
 

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