How can I use a formula on a column containing text?

viv1

New Member
Joined
Jan 26, 2023
Messages
1
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
I have a sheet with the ages of patients written with some ages written in years and some in months, i wanted to make it uniform and convert any ages written in months to years by dividing those cells by 12 to get the year in decimals.

however when i use a formula dividing that cell by 12 it shows up as an error before the word 'month' is in that cell.
is there a way around this without manually deleting the word 'month' from each cell?

i've attached an example to show what i mean
 

Attachments

  • Screenshot 2023-01-26 at 20.41.34.png
    Screenshot 2023-01-26 at 20.41.34.png
    23.1 KB · Views: 11

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
When the age is written in years, is there any text in the cell with the number? If so, show us some examples of what they would look like.
 
Upvote 0
Try this for cells with months. You will need to chand the format. As Rich mentioned to better understand your request post some examples instead of images

Excel Formula:
=LEFT(A3,SEARCH(" ",A3)-1)/12
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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