'If' 'and' statement

vipaman
vipaman used Ask the Experts™
on
I need to check the values of a number of cells and keeping getting errors. D39 is a 'list cell' to control entries

1st check
=IF(D37="No", And(D39="Sea"or"Country")"text1=iftrue","text2=iffalse")

if I then change cell D37 to 'Yes' then
=IF(D37="Yes", And(D39="Sea"or"Country")"text3=iftrue","text4=iffalse")

Thanks in advance Paul
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Can you upload sample and show expectd result?
ShumsManaging Director/Excel VBA Developer
Distinguished Expert 2018

Commented:
I am not sure, where is your Text1, Text2, Text3 or Text4 are:
Try below:
=IF(AND(D37="No",OR(D39="Sea",D39="Country")),"True","False")

Open in new window

Author

Commented:
See attached file. Cell D41 ( titled - Determination of Peak Velocity Pressure) is what I am trying to populate with the output.
scaffoldv3.xlsx
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

ShumsManaging Director/Excel VBA Developer
Distinguished Expert 2018

Commented:
Paul,

Check attached, above formula in your sample workbook.
scaffoldv3.xlsx

Author

Commented:
Shums, logic is nearly there. I'll try and explain. When cell D37 = No and D39 = Sea or Country them D41= equation 1 if false then = equation 2.
If D37 = Yes and D39 = Town then D41 = equation 3  

Hope that makes sense?
ShumsManaging Director/Excel VBA Developer
Distinguished Expert 2018

Commented:
Hi Paul,

Where is equation? I mean in which cells?
Analyst Assistant
Commented:
Perhaps this is what you want.

=IF(D37="No", IF(OR(D39="Sea", D39="Country"), equation1, equation2),IF(D39="Town", equation3))

Author

Commented:
I want the calc to be done in cell D41. Just got to deal with daughter for an hour.
ShumsManaging Director/Excel VBA Developer
Distinguished Expert 2018

Commented:
Try below:
=IF(AND(D37="Yes",D39="Town"),"Equation3",IF(AND(D37="No",OR(D39="Sea",D39="Country")),"Equation1","Equation2"))

Open in new window

scaffoldv3.xlsx

Author

Commented:
Excellent thanks chaps
ShumsManaging Director/Excel VBA Developer
Distinguished Expert 2018

Commented:
Paul,

If any of our solution served your purpose, I would request you to please close the question.

Regards,

Author

Commented:
A concise answer
ShumsManaging Director/Excel VBA Developer
Distinguished Expert 2018

Commented:
Try changing D37 as Yes and D39 as Sea or Country, Accepted answer will result as "FALSE".

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial