Can I use any sort of formulas in custom formatting?

ExcelantePicante

New Member
Joined
Aug 19, 2021
Messages
1
Office Version
  1. 2016
Platform
  1. Windows
I have a report that gives the time as "8/19/2021 12:26:01 AM -04:00", but I need the " -04:00" part to be taken off. Is there any way to custom format or integrate a formula within that custom format so this would be the case?

I want to avoid altering the spreadsheet otherwise. My alternate solution is to insert a row with the formula =LEFT(A2, LEN(A2)-7) to remove the extra information. However, I would like to do this by directly changing the format of the cells themselves so I don't have to adjust anything else. Thanks for the help!
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
I would say that what you have is a text string rather than a valid time, if that is the case then it can not be formatted.

You could try using text to columns with - as a delimiter then skip the second column.
 
Upvote 0

Forum statistics

Threads
1,214,833
Messages
6,121,864
Members
449,052
Latest member
Fuddy_Duddy

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