My macro logic is rusty. Have a large source table with a primary key column and numerous stage-gate date fields requiring time deltas between them, in hours. There is consistent logic to apply between every variation of [Start Date]/[End Date], logic much more complicated than what a DATEDIFF could manage. For each input row, I'd like to reference the same 'macro' for each pair of Start/End dates; each time returning the hours between the dates.
Is a Standard Macro the best approach? The input data source is a pretty beefy workflow, and I'm envisioning the hours calculations to be the last part of the workflow.
Guidance? (I do have the workflow in a macro that correctly returns what I'm looking for, based on my 1 row of test data on the macro input tool)
Modified to include attachments:
Input Data.xlsx - mock data source showing stage gates and desired columns to populate
Calc State Get Hours Macro - sample of 1 record in Text Input that computes desired hours based on blackout dates
DIM Calendar.xlsx - mock calendar file showing which dates are blackout dates.
@KenAtHubbell is it possible to see some of the data, as I'm struggle to see why date diff wouldn't work
In short, the company maintains a time dimension that includes blackout dates. The time calculation needs to exclude the blackout dates that may be between a starting and ending date. I will put a mock workflow together later if this isn't enough information. Thanks!!!
@KenAtHubbell I would use this formula then
If !isempty([start]) and !isempty([end]) then DateTimeDiff([end],[start],"hours") else "N/A" endif
or however you identify the blackout date
Modified original post to include attachments. Thanks again!

