Finding the average based on Yes or No

StillUnderstanding

Board Regular
Joined
Jan 30, 2021
Messages
80
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
Hello,

I wonder if anyone will be able to help me with this.

I am try to work out how many hours you should work per day. So if I am contracted to work 37 hours (A4) and I have Yes in E2 to I2 then I would expect to see 7.24 in E4 to I4. If However I only say yes to 4 of the 5 days (E3 to H3) then I would expect to see 9.25 on (E4 to H4) and 0 in I4.

I can't work out the formula. Would someone please be able to help?

This is as close as I have been able to get it =$B$4/COUNTIF($F$3:$J$3,"Yes") but its showing 37 in each cell (E4 to I4).

Thank you.


1​
ABCDEFGHI
2​
Work Day
MondayTuesdayWednesdayThursdayFriday
3​
Contracted HoursIs this a working Day?YesYesYesYesYes
4​
37.00Hours Worked7.247.247.247.247.24
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Try

=IF(E2="yes",$A$3/COUNTIF($E$2:$I$2,"yes"),0)

1669626498723.png
 
Upvote 0
=$B$4/COUNTIF($F$3:$J$3,"Yes")

working for me


Book1
ABCDEFGHIJK
1Work DayMondayTuesdayWednesdayThursdayFriday
2Contracted HoursIs this a working Day?YesYesYes
337Hours Worked7.247.247.247.247.24
4
512.333333312.333333312.333333312.333333312.3333333
Sheet1
Cell Formulas
RangeFormula
G5:K5G5=$A$3/COUNTIF($G$2:$K$2,"Yes")
 
Upvote 0
Better option to avoid typos
In E3
=IF(UPPER(E2)="YES",$A$3/UPPER(COUNTIF($E$2:$I$2,"YES")),0)
 
Upvote 0
Solution

Forum statistics

Threads
1,214,978
Messages
6,122,549
Members
449,089
Latest member
davidcom

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top