Convert text to number of days

erahi

New Member
Joined
Jul 9, 2012
Messages
9
I need a way to convert a text field to number of days. Can this be done easily?

The entries look like this:

1 year 3 weeks
1 month 2 days
2 years 4 months
3 weeks 1 day
2 years 7 months
1 week 3 days
3 months 1 week

etc.
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
I need a way to convert a text field to number of days. Can this be done easily?

The entries look like this:

1 year 3 weeks
1 month 2 days
2 years 4 months
3 weeks 1 day
2 years 7 months
1 week 3 days
3 months 1 week

etc.
The problem with your request is you have months in there... that makes the answer dependent on the starting starting date given that the number of days within the months which, in turn, means there is no solution to your problem given the information you have provided.
 
Upvote 0
I need a way to convert a text field to number of days. Can this be done easily?

The entries look like this:

1 year 3 weeks
1 month 2 days
2 years 4 months
3 weeks 1 day
2 years 7 months
1 week 3 days
3 months 1 week

etc.

Nice question ("frowning")
Easily?

I have a few questions of my own.
How important is it to know which year? Leap years will influence reporting? Does your sheet have a column to report that?
Assumedly the Year will begin from 1 January?
Similarly the length of months can be 28,29,30 or 31. Therefore, when dealing with one month, can that be detected? With several months can the start month be detected?
Again, I assume that a week will be from Sunday, and therefore 7 days.

Depending upon your answers I'm thinking that a macro would be the only way. That said, if your sheet had columns like:
Start Year, Start Month, someone might be able to produce a formula which could be copied down your No. of Days column.

Hope that gives some guidance.
 
Upvote 0

Forum statistics

Threads
1,214,540
Messages
6,120,107
Members
448,945
Latest member
Vmanchoppy

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