May 20 2024 08:54 AM
I am calculating Per Diem Days. Right now I use =COUNTIF(G111:M111,">0") for all employees, there is one employee who is paid 5 no matter days worked unless he more than 5 with a max of 7 days in the week. I am not sure what formula I should use.
May 20 2024 09:09 AM
It's better if you share sample file which illustrates how your data is structured. In particular, how Excel knows how many days employee worked in this or that week.
May 20 2024 09:11 AM
SolutionTo create a formula that ensures a cell equals 5 unless the days are more than 5 (with a maximum of 7 days), you can use the COUNTIF function along with the IF and MIN functions to handle the conditions. Here's how you can construct the formula:
Here's the formula:
=IF(COUNTIF(G111:M111,">0") > 5, MIN(COUNTIF(G111:M111,">0"), 7), 5)
Explanation:
Example:
Let's assume the range G111:M111 contains the following values:
G111 | H111 | I111 | J111 | K111 | L111 | M111 |
1 | 1 | 1 | 1 | 1 | 1 | 1 |
Thus, this formula ensures that the cell will always be 5 unless the number of days worked is more than 5, in which case it will return the actual count with a maximum of 7. The text was created with the help of AI.
My answers are voluntary and without guarantee!
Hope this will help you.
Was the answer useful? Mark as best response and like it!
This will help all forum participants.
May 20 2024 09:41 AM
May 20 2024 09:11 AM
SolutionTo create a formula that ensures a cell equals 5 unless the days are more than 5 (with a maximum of 7 days), you can use the COUNTIF function along with the IF and MIN functions to handle the conditions. Here's how you can construct the formula:
Here's the formula:
=IF(COUNTIF(G111:M111,">0") > 5, MIN(COUNTIF(G111:M111,">0"), 7), 5)
Explanation:
Example:
Let's assume the range G111:M111 contains the following values:
G111 | H111 | I111 | J111 | K111 | L111 | M111 |
1 | 1 | 1 | 1 | 1 | 1 | 1 |
Thus, this formula ensures that the cell will always be 5 unless the number of days worked is more than 5, in which case it will return the actual count with a maximum of 7. The text was created with the help of AI.
My answers are voluntary and without guarantee!
Hope this will help you.
Was the answer useful? Mark as best response and like it!
This will help all forum participants.