IF AND OR problem.

R

Romileyrunner1

Hi,
I want to do something on the lines of ....

=IF(H3="Mr D", AND IF(J3={"Mon", "Tues", "Wed","Thurs","Fri"},12-1pm),IF
(H3="Mr O, AND IF(J3={"Mon", "Tues", "Wed","Thurs","Fri"}7.45-8.45am)

If that makes any sense to anybody AND IF ANYONE CAN SORT IT OUT, I would be
very grateful.
Thanks folks.
RR1
 
T

T. Valko

Try this:

=IF(AND(H3="Mr
D",OR(J3={"Mon","Tues","Wed","Thurs","Fri"})),"12-1pm",IF(AND(H3="Mr
O",OR(J3={"Mon", "Tues","Wed","Thurs","Fri"})),"7.45-8.45am",""))
 
D

Dave Peterson

Maybe...

=IF(AND(H3="Mr D",OR(J3={"Mon","Tues","Wed","Thurs","Fri"})),"12-1pm",
IF(AND(H3="Mr O",OR(J3={"Mon","Tues","Wed","Thurs","Fri"})),"7.45-8.45am",
"what happens otherwise"))
 
J

Jacob Skaria

Try the below

=IF(ISNUMBER(MATCH(J3,{"Mon","Tues","Wed","Thurs","Fri"})),
IF(H3="Mr D","12-1pm",IF(H3="Mr O","7.45-8.45am","")),"")

If this post helps click Yes
 
P

Pete_UK

The correct syntax would be:

=IF(AND(H3="Mr D",OR
(J3="Mon",J3="Tues",J3="Wed",J3="Thurs",J3="Fri")),"12-1pm",IF(AND
(H3="Mr O", OR
(J3="Mon",J3="Tues",J3="Wed",J3="Thurs",J3="Fri")),"7.45-8.45am",""))

This will return a blank if those conditions are not met.

Hope this helps.

Pete
 
J

Jacob Skaria

'correction

=IF(ISNUMBER(MATCH(J3,{"Mon","Tues","Wed","Thurs","Fri"},0)),
IF(H3="Mr D","12-1pm",IF(H3="Mr O","7.45-8.45am","")),"")

If this post helps click Yes
 
B

Bernard Liengme

=IF(AND(H4="Mr
D",ISNUMBER(MATCH(J4,{"Mon","Tues","Wed","Thurs","Fri"},0))),"12-1pm",IF(AND(H4="Mr
O",ISNUMBER(MATCH(J4,{"Mon","Tues","Wed","Thurs","Fri"}))),"7.45-8.45am",""))
best wishes
 
J

Jacob Skaria

Thanks for the feedback..Please use the corrected version.

If this post helps click Yes
 
R

Romileyrunner1

Works great Dave.
Thanks Mate.
RR1

Dave Peterson said:
Maybe...

=IF(AND(H3="Mr D",OR(J3={"Mon","Tues","Wed","Thurs","Fri"})),"12-1pm",
IF(AND(H3="Mr O",OR(J3={"Mon","Tues","Wed","Thurs","Fri"})),"7.45-8.45am",
"what happens otherwise"))
 

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