2 min readfrom Microsoft Excel | Help & Support with your Formula, Macro, and VBA problems | A Reddit Community

VBA parsing string to calculate

Our take

In dispatch operations, accurately parsing and calculating date and time data is crucial, especially when working with complex formats like Year and Julian Date (YDDD)/(HHMM). This process often involves converting strings into usable date-time formats, performing calculations such as adding hours or subtracting time, and then reconstructing the string for seamless integration. Utilizing VBA or Python within Excel 365 can streamline this workflow, making it more efficient and foolproof for dispatchers.

VBA de-converting a string, doing a computation, and reconverting

For a dispatch operation we grab dates and times in the format in the attached photo. Running with GMT timing.

Format is Year and date (YDDD)/(HHMM) (2026 Feb 26)/(1545z) which is the last number of the year, and the Julian date for number of days in the year has passed. The issues I’m running into trying to keep it tidy and foolproof for my other dispatchers, is finding a way to have excel parse the date time group in this format, and do a +12 hour calculation

The second set of two lines is when we have something leaving and when a subtracted time to start working on that. -3 hours 45 minutes as an example.

It’s a data entry driven process for the left column where we copy paste those entries, and I want them to auto populate in the right column

I need to avoid multiple columns, and need date and times combined and need to avoid using local times (as this would need a manual time conversion into the sheet) and standard time subtraction runs into issues when I have negative times and it doesn’t roll over. I haven’t been able to get =-/+TIME(3,45,0) breaks when I have Julian date and time separated and the HHMM rolls over it throw an error

I believe VBA or maybe python (running on Excel 365) could get me there, but I am at loss of how to deconstruct the string, have excel do the date and time conversation, and reconstruct the string in the format it was input with.

submitted by /u/WoundedAce
[link] [comments]

Read on the original site

Open the publisher's page for the full experience

View original article

Related Articles

Tagged with

#Excel alternatives for data analysis#real-time data collaboration#real-time collaboration#generative AI for data analysis#natural language processing for spreadsheets#Excel compatibility#Excel alternatives#financial modeling with spreadsheets#rows.com#big data management in spreadsheets#conversational data analysis#AI-driven spreadsheet solutions#intelligent data visualization#data visualization tools#enterprise data management#big data performance#data analysis tools#data cleaning solutions#VBA#string parsing