Are you using cells A1 and B1 as in the suggested formulas?
Please tell us exactly what is in the two cells. If a formula, please post the formula and the result on the board. If a value, please tell us exactly what value was typed/pasted etc in the cells.
Please tell us how the two cells are formatted.
Both formulas (onlyadrafter's and mine) produce numerical values for me (with slightly different results for some time values).
Here is a sheet with times in columns A and B.
My formula is used in column D
onlyadrafter's formula is used in column F
There are no problems with #VALUE or #NAME so there must be something different with your sheet and we need to find out what.