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: 10

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
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,215,026
Messages
6,122,743
Members
449,094
Latest member
dsharae57

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