#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 117
Default Calculate Age

I have a column (E:E) for Dates of Birth, and the next column (F:F) has a
formula to calculate the age as follows: =(TODAY()-E:E)/365
Cells of column F:F are formatted as "Number" with decimal places "1".
I also have a conditional formatting to highlight cells in that column that
have an age between 0 and 3. the condition reads as follows:
Cell value is BETWEEN 0 AND 3

I also have a cell at the bottom of column F:F that counts the TOTAL number
of children under 3 years of age using the formula: =COUNTIF(F12:F18, "<3")

So far all sound logical. However, something very weird is happening:

Considering TODAY() is 23/05/07, when I enter a date of birth 02/06/04, the
age then appears as 3.0, this age cell gets highlighted accroding to the
Conditional Formatting, and the child gets counted in the TOTAL even though
the formula in the TOTAL cell counts those <3 not those <=3

And if I enter a date of birth 15/05/04, the age cell calculates the age as
3.0, however, the cell doesn't get highlighted according to the Conditional
Formatting and that child doesn't get counted in the TOTAL cell!

How come the values of the age cells are treated differently even though
they are both equal 3.0?

Your assistance will be greatly appreciated.
Tendresse


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 14
Default Calculate Age

Tendresse

I think the issue you are having is the fact that even though you limit the
cell value to 1 decimel point, the calculations use that actual numbers. If
you extend the values of column F, the first one is 2.969 and the second one
is 3.019. Therefore the first one would get counted and the second one would
not.

Hope this helps.
--
TG


"Tendresse" wrote:

I have a column (E:E) for Dates of Birth, and the next column (F:F) has a
formula to calculate the age as follows: =(TODAY()-E:E)/365
Cells of column F:F are formatted as "Number" with decimal places "1".
I also have a conditional formatting to highlight cells in that column that
have an age between 0 and 3. the condition reads as follows:
Cell value is BETWEEN 0 AND 3

I also have a cell at the bottom of column F:F that counts the TOTAL number
of children under 3 years of age using the formula: =COUNTIF(F12:F18, "<3")

So far all sound logical. However, something very weird is happening:

Considering TODAY() is 23/05/07, when I enter a date of birth 02/06/04, the
age then appears as 3.0, this age cell gets highlighted accroding to the
Conditional Formatting, and the child gets counted in the TOTAL even though
the formula in the TOTAL cell counts those <3 not those <=3

And if I enter a date of birth 15/05/04, the age cell calculates the age as
3.0, however, the cell doesn't get highlighted according to the Conditional
Formatting and that child doesn't get counted in the TOTAL cell!

How come the values of the age cells are treated differently even though
they are both equal 3.0?

Your assistance will be greatly appreciated.
Tendresse


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 14
Default Calculate Age

I should have also said that you can go to
tools---options--calculation---check Precision as displayed box.
--
TG


"Tendresse" wrote:

I have a column (E:E) for Dates of Birth, and the next column (F:F) has a
formula to calculate the age as follows: =(TODAY()-E:E)/365
Cells of column F:F are formatted as "Number" with decimal places "1".
I also have a conditional formatting to highlight cells in that column that
have an age between 0 and 3. the condition reads as follows:
Cell value is BETWEEN 0 AND 3

I also have a cell at the bottom of column F:F that counts the TOTAL number
of children under 3 years of age using the formula: =COUNTIF(F12:F18, "<3")

So far all sound logical. However, something very weird is happening:

Considering TODAY() is 23/05/07, when I enter a date of birth 02/06/04, the
age then appears as 3.0, this age cell gets highlighted accroding to the
Conditional Formatting, and the child gets counted in the TOTAL even though
the formula in the TOTAL cell counts those <3 not those <=3

And if I enter a date of birth 15/05/04, the age cell calculates the age as
3.0, however, the cell doesn't get highlighted according to the Conditional
Formatting and that child doesn't get counted in the TOTAL cell!

How come the values of the age cells are treated differently even though
they are both equal 3.0?

Your assistance will be greatly appreciated.
Tendresse


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 117
Default Calculate Age

Thank you very much, Gerigto. That makes sense. Well, I suppose the way to go
around it is to format the age cell to 2 decimal points rather than 1.

Thanks again for your reply. That was really helpful.

Tendresse

"Gerigto" wrote:

Tendresse

I think the issue you are having is the fact that even though you limit the
cell value to 1 decimel point, the calculations use that actual numbers. If
you extend the values of column F, the first one is 2.969 and the second one
is 3.019. Therefore the first one would get counted and the second one would
not.

Hope this helps.
--
TG


"Tendresse" wrote:

I have a column (E:E) for Dates of Birth, and the next column (F:F) has a
formula to calculate the age as follows: =(TODAY()-E:E)/365
Cells of column F:F are formatted as "Number" with decimal places "1".
I also have a conditional formatting to highlight cells in that column that
have an age between 0 and 3. the condition reads as follows:
Cell value is BETWEEN 0 AND 3

I also have a cell at the bottom of column F:F that counts the TOTAL number
of children under 3 years of age using the formula: =COUNTIF(F12:F18, "<3")

So far all sound logical. However, something very weird is happening:

Considering TODAY() is 23/05/07, when I enter a date of birth 02/06/04, the
age then appears as 3.0, this age cell gets highlighted accroding to the
Conditional Formatting, and the child gets counted in the TOTAL even though
the formula in the TOTAL cell counts those <3 not those <=3

And if I enter a date of birth 15/05/04, the age cell calculates the age as
3.0, however, the cell doesn't get highlighted according to the Conditional
Formatting and that child doesn't get counted in the TOTAL cell!

How come the values of the age cells are treated differently even though
they are both equal 3.0?

Your assistance will be greatly appreciated.
Tendresse


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 117
Default Calculate Age

Gerigto,

That last tip was very handy. Thanks a million.

Tendresse

"Gerigto" wrote:

I should have also said that you can go to
tools---options--calculation---check Precision as displayed box.
--
TG


"Tendresse" wrote:

I have a column (E:E) for Dates of Birth, and the next column (F:F) has a
formula to calculate the age as follows: =(TODAY()-E:E)/365
Cells of column F:F are formatted as "Number" with decimal places "1".
I also have a conditional formatting to highlight cells in that column that
have an age between 0 and 3. the condition reads as follows:
Cell value is BETWEEN 0 AND 3

I also have a cell at the bottom of column F:F that counts the TOTAL number
of children under 3 years of age using the formula: =COUNTIF(F12:F18, "<3")

So far all sound logical. However, something very weird is happening:

Considering TODAY() is 23/05/07, when I enter a date of birth 02/06/04, the
age then appears as 3.0, this age cell gets highlighted accroding to the
Conditional Formatting, and the child gets counted in the TOTAL even though
the formula in the TOTAL cell counts those <3 not those <=3

And if I enter a date of birth 15/05/04, the age cell calculates the age as
3.0, however, the cell doesn't get highlighted according to the Conditional
Formatting and that child doesn't get counted in the TOTAL cell!

How come the values of the age cells are treated differently even though
they are both equal 3.0?

Your assistance will be greatly appreciated.
Tendresse




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,345
Default Calculate Age

If it is not too late, use the DATEDIF() function which is only documented
in XL2000 but is in every version since XL95:

=IF(E:E,DATEDIF(E:E,TODAY(),"y"),"")

This will return a the age with no decimal places.

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


with @tiscali.co.uk


"Tendresse" wrote in message
...
I have a column (E:E) for Dates of Birth, and the next column (F:F) has a
formula to calculate the age as follows: =(TODAY()-E:E)/365
Cells of column F:F are formatted as "Number" with decimal places "1".
I also have a conditional formatting to highlight cells in that column
that
have an age between 0 and 3. the condition reads as follows:
Cell value is BETWEEN 0 AND 3

I also have a cell at the bottom of column F:F that counts the TOTAL
number
of children under 3 years of age using the formula: =COUNTIF(F12:F18,
"<3")

So far all sound logical. However, something very weird is happening:

Considering TODAY() is 23/05/07, when I enter a date of birth 02/06/04,
the
age then appears as 3.0, this age cell gets highlighted accroding to the
Conditional Formatting, and the child gets counted in the TOTAL even
though
the formula in the TOTAL cell counts those <3 not those <=3

And if I enter a date of birth 15/05/04, the age cell calculates the age
as
3.0, however, the cell doesn't get highlighted according to the
Conditional
Formatting and that child doesn't get counted in the TOTAL cell!

How come the values of the age cells are treated differently even though
they are both equal 3.0?

Your assistance will be greatly appreciated.
Tendresse




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I calculate in an IF Takia Excel Worksheet Functions 3 August 23rd 06 09:33 PM
How to calculate an age? PattiJ621 Excel Worksheet Functions 4 March 15th 06 04:46 PM
Calculate Carbob Excel Worksheet Functions 2 March 1st 06 02:27 PM
calculate APR on ARM John McHugh Excel Worksheet Functions 1 May 14th 05 07:56 AM
Calculate AdamMCW Excel Discussion (Misc queries) 3 March 30th 05 12:28 AM


All times are GMT +1. The time now is 02:29 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"