LEFT Function

UpTheArgyle

Board Regular
Joined
Jan 12, 2006
Messages
179
Hi I have a cell formatted as a time - so "A1" is 18:04:20 - (4 minutes past 6pm)

What i want to do use the LEFT function in cell "B2" so as i only have the number representing the actual hour, in this case 6pm - this is so i can pivot table by hour of the day and ignore seconds and minutes.

Using this - =LEFT(A1,2) i get a result of "0."

Any ideas?

Thanks
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Hi I have a cell formatted as a time - so "A1" is 18:04:20 - (4 minutes past 6pm)

What i want to do use the LEFT function in cell "B2" so as i only have the number representing the actual hour, in this case 6pm - this is so i can pivot table by hour of the day and ignore seconds and minutes.

Using this - =LEFT(A1,2) i get a result of "0."

Any ideas?

Thanks

=HOUR(A1)

would work better.

I believe PT can organize the data by year, month, but also by hour.
 
Upvote 0
Incidentally, rather than using a separate column, you should be able to Group on this Date field within the Pivot Table itself (without using a separate formula column) and group on Hours. Right-click on the Date row field and select Group & Show Detail>Group
 
Upvote 0

Forum statistics

Threads
1,224,524
Messages
6,179,308
Members
452,904
Latest member
CodeMasterX

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