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

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
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,223,249
Messages
6,171,031
Members
452,374
Latest member
keccles

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