BradleyS
Active Member
- Joined
- Oct 28, 2006
- Messages
- 351
- Office Version
- 2010
- Platform
- Windows
I have a formula to get the age in years and months which works great =DATEDIF($B2,$C2,"y")&"."&DATEDIF($B2,$C2,"ym"), but I need to convert it into a number, so that I can use it in an autofilter.
However, when I try to convert it to a number format, I just can't get it in the correct format.
The 3.10 shows as 3.1 and so does the actual 3.1 value, so one cannot be distinguished by the other. I ideally need the numbers to show as listed under the 1st column.
I have tried TextToColumns, PasteSpecial Multiply by 1, VBA .Value = .Value
If you add an autofilter to the table and use the last column which has been converted to a number and try to filter ages <=3.4, you will see that it includes 3.10 and 3.11, which I do not want.
Does anyone have a resolve to my predicament?
However, when I try to convert it to a number format, I just can't get it in the correct format.
The 3.10 shows as 3.1 and so does the actual 3.1 value, so one cannot be distinguished by the other. I ideally need the numbers to show as listed under the 1st column.
I have tried TextToColumns, PasteSpecial Multiply by 1, VBA .Value = .Value
If you add an autofilter to the table and use the last column which has been converted to a number and try to filter ages <=3.4, you will see that it includes 3.10 and 3.11, which I do not want.
Does anyone have a resolve to my predicament?
Required | Date of Birth | Today | Calc Age | Converted |
3.12 | 05/11/2020 | 05/11/2024 | 4.0 | 4 |
3.11 | 05/12/2020 | 05/11/2024 | 3.11 | 3.11 |
3.1 | 05/01/2021 | 05/11/2024 | 3.10 | 3.1 |
3.09 | 05/02/2021 | 05/11/2024 | 3.9 | 3.9 |
3.08 | 05/03/2021 | 05/11/2024 | 3.8 | 3.8 |
3.07 | 05/04/2021 | 05/11/2024 | 3.7 | 3.7 |
3.06 | 05/05/2021 | 05/11/2024 | 3.6 | 3.6 |
3.05 | 05/06/2021 | 05/11/2024 | 3.5 | 3.5 |
3.04 | 05/07/2021 | 05/11/2024 | 3.4 | 3.4 |
3.03 | 05/08/2021 | 05/11/2024 | 3.3 | 3.3 |
3.02 | 05/09/2021 | 05/11/2024 | 3.2 | 3.2 |
3.01 | 05/10/2021 | 05/11/2024 | 3.1 | 3.1 |
3 | 05/11/2021 | 05/11/2024 | 3.0 | 3 |