Hi,
I have created a formula that calculates the age of a person based on the date entered:
=DATEDIF(B9,TODAY(),"Y")
=DATEDIF(B9,TODAY(),"YM")
and then i put the data into another cell:
=VALUE(AA8)&"."&(AA9)
so for example i have the age of 4.5.
Then I want to see if the age is between which age group so i have defined 2 age groups(min and max in different cells)
[TABLE="width: 500"]
<tbody>[TR]
[TD]0.3
[/TD]
[TD]3
[/TD]
[/TR]
[TR]
[TD]4
[/TD]
[TD]5
[/TD]
[/TR]
</tbody>[/TABLE]
So I use this formula:
=IF(AND(AB12>Z21,AB12<Y21),V20,IF(AND(AB12>Z22,AB12<Y22),V21,"ERROR"))
However it seems that it cannot calculate it properly, if I use 'OR' it works however I need it to match both min/max to hit the correct age group
I'm sure i'm missing something basic, I even tried this: '=AND(AB12<=Y22,AB12>=Z22)' however it returned 'FALSE' so I know it cannot read the cell that gives the age properly - could it be the '.' there or maybe the cell category?
Thanks in advance for your help
I have created a formula that calculates the age of a person based on the date entered:
=DATEDIF(B9,TODAY(),"Y")
=DATEDIF(B9,TODAY(),"YM")
and then i put the data into another cell:
=VALUE(AA8)&"."&(AA9)
so for example i have the age of 4.5.
Then I want to see if the age is between which age group so i have defined 2 age groups(min and max in different cells)
[TABLE="width: 500"]
<tbody>[TR]
[TD]0.3
[/TD]
[TD]3
[/TD]
[/TR]
[TR]
[TD]4
[/TD]
[TD]5
[/TD]
[/TR]
</tbody>[/TABLE]
So I use this formula:
=IF(AND(AB12>Z21,AB12<Y21),V20,IF(AND(AB12>Z22,AB12<Y22),V21,"ERROR"))
However it seems that it cannot calculate it properly, if I use 'OR' it works however I need it to match both min/max to hit the correct age group
I'm sure i'm missing something basic, I even tried this: '=AND(AB12<=Y22,AB12>=Z22)' however it returned 'FALSE' so I know it cannot read the cell that gives the age properly - could it be the '.' there or maybe the cell category?
Thanks in advance for your help