Excel Split Dimensions Into Two Parts
- Minutes
- min
- Result
- Total minutes
- 150 min
- You entered
Yes, Excel can split dimensions like “10ft x 5ft” or “3m x 4m” into two separate columns for length and width. You can use Excel’s built-in Text to Columns feature, Flash Fill, or formulas to separate the numbers and units, and then convert them to numeric values for calculations.
Formula
The formula to split dimensions depends on the format of your data. For a cell containing a dimension like “10ft x 5ft”, the goal is to extract the first number (length) and the second number (width). If the format is consistent, you can use the following formulas:
- Length (first number):
=VALUE(LEFT(A1, FIND("x", A1)-1))– this finds the position of the “x” and takes everything to the left, converting it to a number. - Width (second number):
=VALUE(MID(A1, FIND("x", A1)+1, LEN(A1)-FIND("x", A1)))– this takes everything after the “x”.
If the dimension includes units like “ft” or “m”, you may need to remove them first using SUBSTITUTE or TRIM. For example, to get the length as a number without the unit: =VALUE(LEFT(SUBSTITUTE(A1,"ft",""), FIND("x", A1)-2)). The exact formula varies with the data format.
Worked Example
Suppose cell A1 contains the text “10ft x 5ft”. Using the basic formulas:
- Length:
=VALUE(LEFT(A1, FIND("x", A1)-1))→ FIND(“x”, A1) returns 6, so LEFT(A1,5) gives “10ft”. VALUE converts “10ft” to 10 (Excel ignores the trailing letters). Result: 10. - Width:
=VALUE(MID(A1, FIND("x", A1)+1, LEN(A1)-FIND("x", A1)))→ MID(A1,7,3) gives “5ft”. VALUE converts to 5. Result: 5.
If you want to keep the units, you can extract them separately with =RIGHT(A1,2) for the unit of the second dimension, or use MID with the position of the space.
Using Text to Columns
Text to Columns is the simplest method when your dimensions are consistently separated by a delimiter like “x” or a space. Steps:
- Select the column with the dimensions.
- Go to the Data tab and click Text to Columns.
- Choose Delimited, then click Next.
- Check the box for “Other” and enter “x” (or the delimiter you use, such as a space).
- Click Finish. The dimensions split into two columns.
This method works well for clean, consistent data. If your data has varying formats (e.g., some with “x” and some with “ by ”), you may need to clean it first or use formulas.
Using Flash Fill
Flash Fill (introduced in Excel 2013) can split dimensions without formulas. Simply type the first part of the dimension in the adjacent column, then press Ctrl+E to fill the rest. For example, if A1 is “10ft x 5ft”, type “10ft” in B1, then Ctrl+E to fill the column with the first parts. Repeat for the second part. Flash Fill works by recognizing patterns, so it’s great for irregular data, but it doesn’t update automatically if the source data changes.
Choosing the Right Method
Which method you choose depends on your needs:
- Text to Columns is best for one-time splitting of large datasets with consistent delimiters.
- Formulas are ideal if you need dynamic results that update when the original data changes.
- Flash Fill is quick for small, irregular datasets, but it’s not dynamic.
If you need to perform calculations with the split numbers (e.g., area = length × width), convert the results to numbers using VALUE or by multiplying by 1. Text to Columns already outputs numbers if the original data is numeric-only, but if units are included, you’ll need to clean them.
Common Problems and Solutions
Here are frequent issues when splitting dimensions:
- Units attached to numbers: Use
SUBSTITUTEto remove units before converting, or use Text to Columns with the space as a delimiter to separate numbers from units. - Inconsistent delimiters: Some cells may use “x”, others “X” or “ by ”. Use
SUBSTITUTEto standardize delimiters first, or use Flash Fill. - Trailing spaces: Use
TRIMto remove extra spaces before splitting. - Numbers with decimals: Formulas work fine, but ensure the decimal separator matches your regional settings.
Alternatives for Complex Data
If your dimensions are part of a larger text string, you can use Excel’s Power Query (Get & Transform) to split columns by delimiter with more control. Power Query allows you to split by multiple characters and handle errors gracefully. For very messy data, you might also use regular expressions (RegEx) via VBA or Power Query’s custom column, but that requires advanced knowledge.
Frequently Asked Questions
How do I split dimensions like “10ft x 5ft” into two columns with just numbers?
Use the formulas =VALUE(LEFT(A1, FIND("x", A1)-1)) and =VALUE(MID(A1, FIND("x", A1)+1, LEN(A1)-FIND("x", A1))). These extract the text before and after the “x” and convert it to numbers, ignoring the units.
What if my dimensions use a different separator like “ by ”?
Replace the separator with a consistent one using =SUBSTITUTE(A1, " by ", "x"), then use the formulas above. Alternatively, use Text to Columns with “by” as the delimiter.
Can I split dimensions without formulas?
Yes, use Text to Columns or Flash Fill. Text to Columns is under Data > Text to Columns, and Flash Fill is triggered with Ctrl+E after typing the first example.
Why does my formula return a #VALUE error?
This usually happens when the text isn’t in the expected format, such as missing “x” or having extra spaces. Use TRIM and SUBSTITUTE to clean the data first, or check that the cell contains the delimiter.
How do I split dimensions with units into separate columns for numbers and units?
Use Text to Columns with space as the delimiter to separate “10ft” into “10” and “ft”. Or use formulas: =LEFT(A1, FIND(" ", A1)-1) for the number and =MID(A1, FIND(" ", A1)+1, 2) for the unit.
Will the split update automatically if I change the original data?
Only formulas update automatically. Text to Columns and Flash Fill are static. If you need dynamic results, use formulas or Power Query with a refresh.
Related
Formula used
in t | Total minutes | min | 150 | 0 out h | Hours | h | floor(t / 60) | 0 out m | Minutes | min | t - floor(t / 60) * 60 | 0
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.