Reading through the spaces

Nanaia

Active Member
Joined
Jan 11, 2018
Messages
304
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
I have a CSV that is received from another department that I pull into my workbook. One cell contains fractions and the inch mark followed by 17-24 spaces. I'm trying to pull from that cell to indicate what file I need to look in for the information and I'm not sure how the pull the information out of all the extra spaces. I want to pull just the numbers from it (2, 2.5, 3, 3.5, 4 with no inch marks) in a TEXTJOIN. If it were just a single number, I'd use (LEFT(D3,1)) but since the numbers contained in the cell are 1 3/8", 2", 2 1/2", 3", 3 1/2", 4", I can't limit my search to just 1 character. What other way can I do it without modifying the CSV?
 
Last edited:

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.
Your question isn't very clear; I tried anyway. In cell A1 I have your data, which contains 20 spaces at the end (where I put an asterix to indicate such). Function SUBSTITUTE can be coerced into replacing the double-quotes by putting either function CHAR(34) or four double-quotes into the old_text argument. Function TRIM will hack out the superfluous spaces. That will report your data without extra spaces and the inch-marks. Is that OK so far?

ABC
11 3/8", 2", 2 1/2", 3", 3 1/2", 4" *1 3/8, 2, 2 1/2, 3, 3 1/2, 4 *1 3/8, 2, 2 1/2, 3, 3 1/2, 4 *

<tbody>
</tbody>
Sheet36

Worksheet Formulas
CellFormula
B1=TRIM(SUBSTITUTE(A1,CHAR(34),""))
C1=TRIM(SUBSTITUTE(A1,"""",""))

<tbody>
</tbody>

<tbody>
</tbody>
 
Last edited:
Upvote 0
My apologies for not being more clear. Explaining how this is all linked together is a bit of a challenge for me. I was trying to avoid putting too much information in my question.
Your B1 formula removed all the extra spaces in every scenario I put it through. Thank you. Your assistance is greatly appreciated!
 
Upvote 0

Forum statistics

Threads
1,214,787
Messages
6,121,569
Members
449,038
Latest member
Guest1337

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