'If' and 'And' statements

jak26

Board Regular
Joined
Dec 4, 2007
Messages
53
Hi
Hopefully someone can help here.

How do you get an 'if' function to evaluate two statements and if both are satisfied then return the correct answer?

I am most familiar with excel which would be:
=if(and(statement1,statement2)>statement3,answer if true,"")

In access I have:

If(statement1 And statement2, answer if correct, "")


Hours: IIf([Start Date Time]<=[ORCA_LABOUR_GROUP_MEMBER]![START_DATE] And [ORCA_LABOUR_GROUP_MEMBER]![END_DATE]>[End Date Time],
([End Date Time]-[ORCA_LABOUR_GROUP_MEMBER]![START_DATE]*24),"")

Any help appreciated

Jeff
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
I put this in, and it worked for me.. what kind of problem do you have with it?

Edit:
actually, I haven't checked the calculation.. you need a paranthesis for your calculation:
(([End Date Time]-[ORCA_LABOUR_GROUP_MEMBER]![START_DATE])*24
 
Last edited:
Upvote 0
You need to put the qualifier in each part of the AND statement.

If(And(statement1>Statement3,Statement2>Statement3), answeriftrue, false)
 
Upvote 0

Forum statistics

Threads
1,215,256
Messages
6,123,911
Members
449,132
Latest member
Rosie14

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top