The Airtable Community will undergo scheduled maintenance on September 17 from 10:00 PM PST to 11:15 PM PST. During this period, you may experience temporary disruptions. We apologize for any inconvenience and appreciate your understanding.

# How to modify only one specific part of the formula IF - example below

Topic Labels: Formulas
Solved
Jump to Solution
653 2
cancel
Showing results for
Search instead for
Did you mean:
4 - Data Explorer

Ok so here's the main formula I'm trying to use for my "Monday Pay Hours" field

IF({Monday Start} = BLANK(), 0,DATETIME_DIFF({Monday End}, {Monday Start}, 'minutes'))/60-0.5
This gives me the exact hours worked, minus a half hour lunch break

It's almost perfect, but what I need is to tell it that - IF the formula all the way up to here:
IF({Monday Start} = BLANK(), 0,DATETIME_DIFF({Monday End}, {Monday Start}, 'minutes'))/60
equals less than 5, then don't add the last step of subtracting the 0.5.

Is this possible?
1 Solution

Accepted Solutions
11 - Venus

Oh, I still hadn't answered your previous question.

How about a formula like this?

``````IF(
AND({Monday Start},{Monday End}),
IF(
DATETIME_DIFF({Monday End}, {Monday Start}, 'minutes')/60 >= 5,
DATETIME_DIFF({Monday End}, {Monday Start}, 'minutes')/60 - 0.5,
DATETIME_DIFF({Monday End}, {Monday Start}, 'minutes')/60
),
0
)``````

2 Replies 2
11 - Venus

Oh, I still hadn't answered your previous question.

How about a formula like this?

``````IF(
AND({Monday Start},{Monday End}),
IF(
DATETIME_DIFF({Monday End}, {Monday Start}, 'minutes')/60 >= 5,
DATETIME_DIFF({Monday End}, {Monday Start}, 'minutes')/60 - 0.5,
DATETIME_DIFF({Monday End}, {Monday Start}, 'minutes')/60
),
0
)``````

4 - Data Explorer

@Sho Thank you SO much!!! This worked like a charm! I don't entirely understand it, but it works!

I've been tearing my hair out trying to solve this one for days. Nailed it!