View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
David Biddulph[_2_] David Biddulph[_2_] is offline
external usenet poster
 
Posts: 8,651
Default if and + formula

It's not clear what you are trying to do with your Saturday test.

Each IF statement has 2 or 3 parameters. The syntax is
IF(condition,result_if_condition_true,result_if_co ndition_false). If you
omit the result_if_condition_false parameter, then it will default to
returning a logical value of FALSE if the condition is not met.
If you want to nest IF functions you can do that by replacing one or other
of the result parameters (or both) by a further IF statement. The most
frequent syntax would be
=IF(first_condition,result_if_first_condition_true ,IF(second_condition,result_if_second_condition_tr ue,result_if_second_condition_false));
you won't get to test the second condition at all if the first condition is
true.
In your proposed revised formula you've already given the first IF statement
its 3 parameters, so it has no way of going on to the 2nd IF (which in any
case has no defined result).
Another option is to combine conditions with an AND or OR function (as you
triied to do in your initial formula, but see below).

I notice a couple of things about your existing formula:
Firstly the 2 parameters for the AND function are identical, so the function
is doing nothing different from having the single condition P30<$S$27
Secondly the results you are returning are both text strings, so yo won't be
able to do further calculations with the result.
[And similarly in the suggested Saturday test you are testing for the text
string "Saturday", not for a date which falls on a Saturday; if the latter
is what you want, you could use =IF(TEXT(N30,"dddd")="Saturday",... or use
the WEEKDAY function.]
--
David Biddulph

"kevcar40" wrote in message
ups.com...
hi
the following formula allows me to adjust the start time of an error
and it works fine

=IF(AND(P30<$S$27,P30<$S$27),"06:00:00",TEXT(MOD(P 30,1),"hh:mm:ss"))

what i am trying to do is ammend the formula to allow me to check
another cell for a day

cell n 30 = Saturday

=IF(AND(P30<$S$27,P30<$S$27),"06:00:00",TEXT(MOD(P 30,1),"hh:mm:ss"),
if(n30 = "Saturday"))
this is not working
can anyone point me in the right direction please

thanks kevin