Forum Discussion
ShazzieH
Oct 20, 2021Copper Contributor
Excel SUMIF with OR or something?
Hi everyone. I hope you can help. I need to calculate the number of hours worked on a spreadsheet sent to me by a client. The worksheet calculates the number of working days in the sheet and multi...
- Oct 20, 2021
ShazzieH may I suggest a different approach to use MIN and MAX to constrain those output instead:
Calculate total hours worked:
=MIN(SUM(SUMIF($A$1:$AE$1,{2,3,4,5,6},$A5:$AE5)+SUM(COUNTIFS($A5:$AE5,{"A","S","U","F"})*9)),$AF$2)Calculate Overtime:
=MAX(SUM(SUMIF($A$1:$AE$1,{2,3,4,5,6},$A5:$AE5))+SUM(COUNTIFS($A5:$AE5,{"A","S","U","F"}))*9-$AF$2,0)
mtarler
Oct 20, 2021Silver Contributor
ShazzieH may I suggest a different approach to use MIN and MAX to constrain those output instead:
Calculate total hours worked:
=MIN(SUM(SUMIF($A$1:$AE$1,{2,3,4,5,6},$A5:$AE5)+SUM(COUNTIFS($A5:$AE5,{"A","S","U","F"})*9)),$AF$2)Calculate Overtime:
=MAX(SUM(SUMIF($A$1:$AE$1,{2,3,4,5,6},$A5:$AE5))+SUM(COUNTIFS($A5:$AE5,{"A","S","U","F"}))*9-$AF$2,0)
- ShazzieHOct 20, 2021Copper Contributor
mtarler many thanks. I will try this tomorrow and let you know. Thank you for the suggestion
Regards, Sharon
- ShazzieHOct 21, 2021Copper ContributorOh wow! I don't know why I didn't think of MIN and Max but it WORKS 🙂 Thank you very much for you help. I really appreciate it 🙂