Sum two formula values

Hello Monday gurus!

I need your help. I have a board that is used to capture values in a form. Those values will either be a timeline value or an individual date value for PTO. (Example: if PTO is more than 1 day then they fill in the timeline, if it’s only 1 day or less they fill in the date/time).

The dates are populating well. The problem is getting a daily hours value for it. If they fill in a timeline, the daily hours should be 8 hours, but if they fill in a date, then it should calculate the time difference of the date column.

I have the values in 2 separate columns but can’t get the values to sum into 1 column for chart purposes. Can you help?

@JCorrell I’m a HUGE fan of your replies on the Monday community. I’d love your insight if you have time. I’m sure I’m missing something small like a comma or something.

And I’m eager to learn from any other Monday pros in the community. Teach me your awesome wisdom please :slight_smile:

I know this is a messy formula, but maybe it’s easier to help me figure out how to remove the error symbol? If that can be removed, I think everything else will work.

Here’s the formula: ROUND(((DATEVALUE({End Date}) + TIMEVALUE({End Date})) - (DATEVALUE({Start Date}) + TIMEVALUE({Start Date}))) * 24,2)

I figured out an alternative. Not ideal but it works.

Instead of having the formula try to calculate based on 2 scenarios (timeline versus date). For every timeline entry, I’ll have to manually fill in the Start and End Date columns. By doing that, the formula will work.

I just received the PERFECT solution from the amazing Support team. Special shout out to Victoria for the video and explanation.

Instead of having 2 formula columns, I only needed one.

Here’s how to setup the solution:

Create 3 columns: (1) Daily Hours (2) Workdays and (3) Total Hours
In the Daily hours column, use this formula: IF(WORKDAYS({Date Range#End},{Date Range#Start})>0,8,IF({Date Range}=“”,HOURS_DIFF(FORMAT_DATE({End Date},“HH:mm”),FORMAT_DATE({Start Date},“HH:mm”)),0))

In the workdays column use this formula: if({Start Date}=“”,WORKDAYS({Date Range#End},{Date Range#Start}),WORKDAYS({End Date},{Start Date}))

In the Total Hours column use this formula: if({Workdays}=1,{Daily Hours},{Daily Hours}*{Workdays})

Result: If an end user submits a timeline for their PTO, it will enter 8 for the Daily hours. If the end user submits two date ranges for their PTO then it will calculate the time difference between the two. And the total hours column will give the value of the Daily Hours column (only if the workdays is equal to 1.) else it will multiple the workdays by the daily hours.