SI(AND()) formula issue in Calc
Solved
Tilili
-
Tilili -
Tilili -
Hello,
I have a problem with a formula in Calc and I can't find my mistake.
Here is the formula:
=IF(AND(F5>=50,H5<=21),"V","NV",IF(AND(F5<40,H5<=15),"V","NV"))
When the formulas are separated, they work but not together.
Thank you for your help.
I have a problem with a formula in Calc and I can't find my mistake.
Here is the formula:
=IF(AND(F5>=50,H5<=21),"V","NV",IF(AND(F5<40,H5<=15),"V","NV"))
When the formulas are separated, they work but not together.
Thank you for your help.
However, if I want to add an additional condition (e.g. If F5>=40 but less than 50; and H5<=18) how should I transform the formula?
Actually, it's: - those under 40 must do 15 minutes or less
- between 40 and 49 years old, they must do 18 minutes or less
- over 50 years old, they must do 21 minutes or less
Thanks again.
In cases like these, I prefer to use nested IF() structures.
For example, we're going to create a function that works step by step:
First, it will check if F5>50 and H5<21, if that's the case it will return "V".
If not, it moves to the next step where it checks if F5<40 and H5<=15, again if that's good, it returns "V", otherwise if that's not the case, it moves to the last step which checks if H5<=18. If that's good, it returns "V", otherwise it returns "NV".
We've handled all cases since those over 50 have been checked first, those under 40 second, and the others (those between 40 and 49) are handled last.
Basically, it would look something like this:
IF(AND(F5>=50;H5<21);"V";IF(AND(F5<40;H5<=15);"V";IF(H5<=18;"V";"NV")))
Well, I still don't have the software to check, so I might have left out or forgotten a parenthesis, but the important thing is to understand the structure :)
- Under 40 years old must complete in 15 minutes or less
- Between 40 and 49 years old, they must complete in 18 minutes or less
- Over 50 years old must complete in 21 minutes or less
The hitch in the formula lies with those aged 40 to 49 who must complete in 18 minutes or less. In your formula, I do not see this age criterion.
If we don't take age into account in the last case, we let many cases pass.
So it would rather give,
IF(AND(F5>=50,H5<=21),"V",IF(AND(F5>=40,H5<=18),"V",IF(AND(F5<40,H5<=15),"V","NV")))
Sorry, I hope you can follow me!
But in any case, I've just tried the formula and it works. Thank you very much for your help. I thought I would never manage.
Thank you.