Converting a text time period into a number

MisTo

New Member
Joined
Aug 6, 2013
Messages
2
Hi

I've got a list of people's tenure which I need to be in a number format in terms of years. The current format is:

0 years, 2 months, 24 days


I want to express this in terms of years so it this particular example would be:

0.232276

Is there a formula that would allow me to convert between the two without working them all out manually? I've got a list of c.400 to get through...

Thanks in advance!



[TABLE="width: 176"]
<TBODY>[TR]
[TD][/TD]
[/TR]
</TBODY><COLGROUP><COL></COLGROUP>[/TABLE]
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Hi,

Suppose your date on A1 please apply the following formula.

=DATEDIF(A1,TODAY(),"d")/365

and change the number format to 2 digit.

Thanks,
SK
 
Upvote 0
Hi

I've got a list of people's tenure which I need to be in a number format in terms of years. The current format is:

0 years, 2 months, 24 days


I want to express this in terms of years so it this particular example would be:

0.232276

Is there a formula that would allow me to convert between the two without working them all out manually? I've got a list of c.400 to get through...

Thanks in advance!



[TABLE="width: 176"]
<TBODY>[TR]
[TD][/TD]
[/TR]
</TBODY>[/TABLE]

Hello and welcome
Is this format consistent along all your data?
 
Upvote 0
Hi - welcome to the board.

Date calcs are often more complex than they should be. In this instance, e.g. if you're calculating decimal fractions of a year, how many days are you using as the devisor? If the 2 months were jan & feb, not same number of days as if they were march & april etc.
 
Upvote 0
HI,

You have to enter the join date (14/05/2013) of particular employee in A1 cell. it will work from joining date to today.

Thanks,
SK
 
Upvote 0
Hello and welcome
Is this format consistent along all your data?

Yes it is.

Paddy D said:
calcs are often more complex than they should be. In this instance, e.g. if you're calculating decimal fractions of a year, how many days are you using as the devisor? If the 2 months were jan & feb, not same number of days as if they were march & april etc.

Basing the calculation on a 365.25 day year - I take your point about months being different lengths...it looks like I will probably need to figure out the start date. If the end date is today is there an easy way to calculate with the data I have?

Thanks
 
Upvote 0
Yes it is.



Basing the calculation on a 365.25 day year - I take your point about months being different lengths...it looks like I will probably need to figure out the start date. If the end date is today is there an easy way to calculate with the data I have?

Thanks

Possible but looon winding...
Try this with the dat you have and taking 30 for a month:
=(TRIM(--LEFT(A1,2))*365.25+TRIM(MID(A1,FIND(",",A1)+2,2))*30+TRIM(--MID(SUBSTITUTE(A1,",","@",2),FIND("@",SUBSTITUTE(A1,",","@",2))+2,2)))/365.25
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,289
Members
452,631
Latest member
a_potato

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top