The Introduction
Have you ever downloaded an inventory spreadsheet or an invoice log where all the data you need is squished together into a single, complicated product code?
Imagine looking at an order ID like ORD-2026-99. To group your data by year, you don't care about the letters or the ending numbers—you only want that middle portion. Retyping thousands of these entries by hand to extract those pieces is an easy way to ruin your afternoon.
You don't need to manually cut and paste your text strings. Google Sheets has three incredibly straightforward functions—LEFT, RIGHT, and MID—that act like laser-targeted text clippers. Let's look at exactly how to use each one to pull out text from the start, the end, or the exact middle of any cell.
Step 1: Set Up Your Tracking Layout
Let's build a clean, non-copyrighted system log grid to see how our slicing formulas operate:
Column A (System Code):
SKU-2026-771|SKU-2027-842|SKU-2028-115Column B (Prefix Slicing): Where we extract the start text
Column C (Year Slicing): Where we extract the middle text
Column D (ID Slicing): Where we extract the end text
Step 2: Grab Text from the Start with LEFT
If you only want to pull out the first few characters of a cell (like the department or warehouse code), use the LEFT function. It looks at a cell and counts forward from the very first letter.
Click on cell B2 and type:
=LEFT(A2, 3)
How it works:
A2points to your raw system code (SKU-2026-771).3tells the formula to grab exactly the first 3 characters.The Result: It instantly spits out SKU.
Step 3: Grab Text from the End with RIGHT
What if you need to capture the unique item digits sitting at the very end of your data string? The RIGHT function works exactly like LEFT, but it starts counting backward from the very last character on the right side.
Click on cell D2 and type:
=RIGHT(A2, 3)
How it works:
The formula starts at the end of the line and pulls the last 3 digits.
The Result: It perfectly isolates 771.
Step 4: Grab Text from the Middle with MID
Pulling text from the middle is where most people get stuck, but the MID function makes it simple. It requires three details: the cell to look at, the character position where it should start cutting, and how many characters to grab.
Let's pull out the year (2026) from our code SKU-2026-771. If you count from the left, letter by letter (S is 1, K is 2, U is 3, and the dash - is 4), our year begins exactly at character position 5. The year is 4 characters long.
Click on cell C2 and type:
=MID(A2, 5, 4)
How it works:
5tells the spreadsheet to skip the first four characters and start cutting at position 5.4tells it to grab a block of 4 characters from that starting point.The Result: It cleanly extracts 2026.
Step 5: Flash Fill Your Clean Data Columns
Once your formulas are set in row 2, highlight cells B2, C2, and D2 at the same time. Double-click the small blue box in the corner of your selection to flash-fill the rules down your entire sheet.
Your messy raw data column is instantly organized into clear, segmented, readable buckets!
Conclusion
Mastering LEFT, RIGHT, and MID ensures you never have to wrestle with messy system text outputs again. They allow you to rapidly parse tracking numbers, database codes, or date strings down into manageable details for your reports.
Try slicing a column of your inventory data tracking logs this week! Are your system strings variable lengths (making it tough to pinpoint a fixed starting character position)? Leave a comment below and we can mix a FIND formula into your code to locate boundaries dynamically.
Comments
Post a Comment