Separating data in a cell

shibigoku

New Member
Joined
Jan 3, 2020
Messages
15
Office Version
  1. 2019
Platform
  1. Windows
Hi,

I work at a call center and we have changed our phone service provider. Unfortunately, the new call reporting system is missing some of the reports we are used too.
We have all the calls data and with pivot tables I managed to get most of the reports such as average talk time etct.
What brought me here is that I was looking for a way to have the data displayed in 30 min intervals and I found it here : Grouping by time in pivot table
However, before I can try this method, the current reports give us the Call start time of each call in a single cell like this : 05/27/2020, 10:55:47 AM
How do I extract just the time, in this case it would be 10:55:47?

Thanks
 
Hi I just realised that I now have a new problem. The new time is always in AM with this method.
I should have mentionned that PM time is displayed like this in the cell : 05/27/2020, 01:14:06 PM therefore when I extract the time I get 01:14:06 AM.
This is harder than I thought.

Haha excel problems do tend to grow! The PowerQuery solution in this instance may be better (but im not too familiar with it).

As a formula solution, this should work:
VBA Code:
=TIME(IF(RIGHT(A2,2)="PM",MID(A2,13,2)+12,MID(A2,13,2)),MID(A2,16,2),MID(A2,19,2))

Let me know
Caleeco
 
Upvote 0

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Hi Caleeco, you're such a great help. It works except for 12 pm. I think it's adding 12 hours so it becomes 12 am is that correct?
 
Upvote 0
Hi Caleeco, you're such a great help. It works except for 12 pm. I think it's adding 12 hours so it becomes 12 am is that correct?

Ah so close! Ok, let me take another look... and see if there is a different approach we can take.

Give me a few mins!

Caleeco ✌
 
Upvote 0
Hi, another option to try.

=0+MID(A2,13,11)

Book1
AB
205/27/2020, 01:14:06 PM1:14 PM
305/27/2020, 12:00:00 PM12:00 PM
Sheet1
Cell Formulas
RangeFormula
B2:B3B2=0+MID(A2,13,11)
 
Upvote 0
You have the formula that Caleeco provided up a couple of posts:
Code:
=TIME(MID(A1,13,2),MID(A1,16,2),MID(A1,19,2))
Now you have to test whether the last two characters in the string are "AM" (do nothing) or "PM" (add 12 hours):
Code:
=TIME(MID(A1,13,2),MID(A1,16,2),MID(A1,19,2)) + IF(RIGHT(A1, 2) = "PM", 0.5, 0)
 
Upvote 0

Forum statistics

Threads
1,214,915
Messages
6,122,212
Members
449,074
Latest member
cancansova

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