Rounding Time Value Issue

FurRobotic

New Member
Joined
Feb 18, 2022
Messages
4
Office Version
  1. 2016
Platform
  1. Windows
1646236503196.png

The above is an issue i'm running into. The formula I'm using in G2 is shown in H2. I cant figure out how to fix the "value" error, any help would be great.
My task is to ROUND the time in column E to the nearest hour
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
That function will only work on valid time entries.
It looks like your data is entered as text, and not as date/time.
I can tell because it is left-justified, and there is no space between the seconds and "AM".
You need to fix your data for that formula to work on it.
 
Upvote 0
Or we can leave the data as-is, and use a formula to convert it to a valid time and perform your rounding on it all in one step, i.e.
Excel Formula:
=MROUND(TIMEVALUE(LEFT(E2,LEN(E2)-2) & " " & RIGHT(E2,2)),"1:00")
 
Upvote 0
Solution
This worked, thank you! For some reason I wasn't able to change the formatting in excel for that column
 
Upvote 0
This worked, thank you! For some reason I wasn't able to change the formatting in excel for that column
Changing the format of the cell will not change the entry from text to date.
You would still need to fix the data in the cells.

Excel does not like no spaces between the seconds and AM/PM. It will not recognize that as a time.
The quick and easy fix would be to do a Find/Replace, replacing all instances of "AM" with " AM" (note the space before "AM").
Then do the same for PM, replacing "PM" with " PM".

That should coerces all those values to be valid times then.
 
Upvote 0

Forum statistics

Threads
1,215,767
Messages
6,126,767
Members
449,336
Latest member
p17tootie

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top