A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
The #VALUE! error with =J5-G5 means at least one of the referenced cells is not a valid Excel time value, even if it looks like one or is formatted as h:mm.
Check and fix the following:
- Confirm the cells are real times, not text
- Select J5 and G5. On the Home tab, in the Number group, change the format to General.
- If they are valid times, you will see decimal values (e.g.,
0.5for 12:00 PM). - If you still see something like
08:30or the cell is left‑aligned, the value is stored as text and will cause#VALUE!.
- Convert text times to real times
For any cell that shows as text when formatted as General:- Re‑enter the time manually (e.g., type
8:30and press Enter). - Or, if many cells are affected, use a helper column and a function that ignores text, such as
=SUM(...), after cleaning the data as needed.
- Re‑enter the time manually (e.g., type
- Check for hidden spaces or special characters
- Ensure the result cell is a time format
After J5 and G5 are valid times,=J5-G5will return a numeric result. Format the formula cell ash:mm(or a custom time format) so the duration displays correctly.
If the error persists even with simple numeric subtraction (for example, =B1-A1 in a new workbook), check the Windows Region settings to ensure the minus sign is not configured as the list separator, as this can also cause #VALUE! in basic subtraction.
References: