How to Calculate Bike and Walking Mileage in Excel (Formulas)
Question details
The user needs to sum mileage for different fitness activities independently, particularly when entries are recorded with prefixes like 'B' for biking and 'W' for walking (e.g., B22.05, W5.87).

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Tracking multiple fitness activities in a single spreadsheet and attempting to automatically calculate the total mileage per specific activity.
- Observed behavior
- Currently, numbers and text are mixed in single cells, preventing standard SUM functions from working correctly. The data requires reorganization or specific formulas to isolate and sum the values based on their category.
Before applying these formulas, decide whether it's easier to adjust your current table layout to separate text and numbers, as a structured layout prevents most calculation errors.
Use a Structured Layout with SUMIFS (Recommended)
Reorganizing your data to have separate category labels is the most reliable and scalable way to calculate totals for specific activities.
Mixing text (like 'B' or 'W') with numbers in the same cell prevents Excel from recognizing the value as a number. By dedicating one row to the activity type and another to the mileage, you can easily use the SUMIFS function.
Create a dedicated row or column for your activity labels (e.g., enter 'Run', 'Walk', or 'Bike' in cells B3 through Y3). Enter the pure numeric mileage directly below or next to the corresponding label (e.g., cells B4 through Y4).
Select the cell where you want the walking total. Enter the formula =SUMIFS($B4:$Y4, $B$3:$Y$3, "Walk") and press Enter.
In the cell for the biking total, enter the formula =SUMIFS($B4:$Y4, $B$3:$Y$3, "Bike") and press Enter.
If you just need a continuous sum of a specific row where only running is logged, simply use =SUM(B4:Y4).

Extract Numbers from Text Entries Using Helper Columns
If you cannot change your current layout and must work with entries like 'W5.87', use text extraction functions to separate the prefix from the mileage.
Calculate Fitness Mileage with WPS Spreadsheet
WPS Spreadsheet offers full support for advanced functions like SUMIFS, LEFT, RIGHT, and VALUE. You can seamlessly manage your fitness trackers, reorganize data, and calculate activity mileage for free with an interface you already know.
- 1. Open your tracker: Launch WPS Spreadsheet and open your fitness tracking workbook.
- 2. Set up your layout: Ensure you have distinct header cells for activities like 'Bike', 'Run', and 'Walk', with numerical mileage directly underneath.
- 3. Enter the SUMIFS formula: Click the cell for your total, go to the Formula bar, and type =SUMIFS(. Select your mileage range, add a comma, select your headers range, add a comma, and type "Bike".
- 4. Complete the calculation: Press Enter to instantly view your total biking mileage. Repeat the process for walking.

Frequently Asked Questions
How do I sum cells that contain both text and numbers without helper columns?
You can use complex array formulas combining SUM, VALUE, and MID, but this is prone to calculation errors and slows down your workbook. It is highly recommended to separate text and numbers into different columns instead.
Why is my SUMIFS formula returning 0 for my mileage?
This usually happens if your numbers are formatted as text, if there are hidden trailing spaces in your criteria headers, or if the sum range and criteria range do not match exactly in size (e.g., comparing rows B3:Y3 to B4:Z4).
Can I use wildcards in SUMIFS to sum cells starting with a specific letter?
SUMIFS can use wildcards (like 'W*') to identify cells, but it cannot automatically extract and sum the numeric portion of a string (like 'W5.87'). The formula will fail because it cannot sum text. You must extract the number first.
Does WPS Spreadsheet support the SUMIFS function?
Yes, WPS Spreadsheet fully supports SUMIFS and is completely compatible with Excel's syntax, allowing you to seamlessly calculate values based on multiple conditions.




