HansHamm
7 years agoQrew Assistant Captain
IF AND Formula Issue
I have to calculate the amount of per diem an associate is to receive. For the most part I can get this to work in Excel with the following formula:
=IF((J2-I2)<=7,(J2-I2)*25,IF(AND((J2-I2)>7,TODAY()<I2),7*25,IF(AND((J2-I2)<7,TODAY()<I2),7)))
I read where Mark Shiner stated for "And" to do something like this: IF(
[Project Actual] = 0 and [Project Forecast] = 0 and [Project Budget] = 0 ,0,
So I tried this
If(
ToDays([Hotel Check-Out Date]-[Hotel Check-In Date])<=7,ToDays([Hotel Check-Out Date]-[Hotel Check-In Date])*25,
If(
ToDays([Hotel Check-Out Date]-[Hotel Check-In Date])> 7 AND Today()<[Hotel Check-In Date],7*25,
If(
ToDays([Hotel Check-Out Date]-[Hotel Check-In Date]),7 AND Today()<[Hotel Check-In Date]),7)))
But I get an error message "the operator 'and' can't be applied to boolean...
Any help would be greatly appreciated
=IF((J2-I2)<=7,(J2-I2)*25,IF(AND((J2-I2)>7,TODAY()<I2),7*25,IF(AND((J2-I2)<7,TODAY()<I2),7)))
I read where Mark Shiner stated for "And" to do something like this: IF(
[Project Actual] = 0 and [Project Forecast] = 0 and [Project Budget] = 0 ,0,
So I tried this
If(
ToDays([Hotel Check-Out Date]-[Hotel Check-In Date])<=7,ToDays([Hotel Check-Out Date]-[Hotel Check-In Date])*25,
If(
ToDays([Hotel Check-Out Date]-[Hotel Check-In Date])> 7 AND Today()<[Hotel Check-In Date],7*25,
If(
ToDays([Hotel Check-Out Date]-[Hotel Check-In Date]),7 AND Today()<[Hotel Check-In Date]),7)))
But I get an error message "the operator 'and' can't be applied to boolean...
Any help would be greatly appreciated