Get different parts of timestamp without MID()

always_confused

Board Regular
Joined
Feb 19, 2021
Messages
68
Office Version
  1. 2016
Platform
  1. Windows
Hello,

I have a spreadsheet with a column containing timestamps (format dd/mm/yyyy hh:mm:ss). I am trying to select certain dates: within a certain month, within a certain year etc. The month I want to select within is selected in a combobox (format yyyy/mm). The way I'm doing it is comparing the combobox value to MID(timestamp_column, 4,7). Which works well enough but it's very slow. I actually have multiple columns of timestamps and they all need to be checked. Is there any built in function do do this? I have seen people using format() but I can't make it work for "mm/yyyy".
In short, my question is: Is there any quicker way to extract different parts of a timestamp value and different combinations of these parts (dd/mm, mm/yyyy etc.)?
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Is your tile stamp real date and time ( right aligned without manual alignment) or text looking like date and time ( formatting is, the underlying values are numbers ( real dates) or text).
 
Upvote 0
Is your tile stamp real date and time ( right aligned without manual alignment) or text looking like date and time ( formatting is, the underlying values are numbers ( real dates) or text).
It's real date and time. The formatting is custom dd/mm/yyyy hh:mm:ss
 
Upvote 0

Forum statistics

Threads
1,214,649
Messages
6,120,728
Members
448,987
Latest member
marion_davis

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