RutlandPuritan
New Member
- Joined
- Nov 8, 2016
- Messages
- 3
Hello.
I have a timetable on Excel. The first worksheet is organized into blocks of different activities.
For each activity there are staff members and participants listed.
On the second worksheet, I use formulae like this one:
=((COUNTIF(Mon!$B$9:$B$14,A4)*$B$2)/COUNTIF(Mon!$B$5:$B$7,"*")/COUNTIF(Mon!$B$9:$B$14,"*"))
So if, for example, Fred's name is in A4, it will give the number of hours as defined in B2. It will then divide this by the number of staff and the number of participants (i.e. if any text is the specified range) to give the total support hours.
This works fine except if (in this instance) B9:B14 and B5:B7 are blank. It then produces a #DIV/0! error.
This is a problem because the cell adds up for all of the activity blocks and looks like this:
Sometimes certain activity blocks will be empty and others, which were empty, filled in. I want this formula to give me the results without having to change it all the time.
So what I would like Excel to do is ignore one range of cells if it is blank, but still continue to add up the others which are not blank.
Is this achievable?
I have a timetable on Excel. The first worksheet is organized into blocks of different activities.
For each activity there are staff members and participants listed.
On the second worksheet, I use formulae like this one:
=((COUNTIF(Mon!$B$9:$B$14,A4)*$B$2)/COUNTIF(Mon!$B$5:$B$7,"*")/COUNTIF(Mon!$B$9:$B$14,"*"))
So if, for example, Fred's name is in A4, it will give the number of hours as defined in B2. It will then divide this by the number of staff and the number of participants (i.e. if any text is the specified range) to give the total support hours.
This works fine except if (in this instance) B9:B14 and B5:B7 are blank. It then produces a #DIV/0! error.
This is a problem because the cell adds up for all of the activity blocks and looks like this:
=((COUNTIF(Mon!$B$9:$B$14,A4)*$B$2)/COUNTIF(Mon!$B$5:$B$7,"*")/COUNTIF(Mon!$B$9:$B$14,"*"))
+((COUNTIF(Mon!$B$19:$B$24,A4)*$B$2)/COUNTIF(Mon!$B$17,"*")/COUNTIF(Mon!$B$19:$B$24,"*"))
+((COUNTIF(Mon!$B$30:$B$36,A4)*$B$2)/COUNTIF(Mon!$B$27:$B$28,"*")/COUNTIF(Mon!$B$30:$B$36,"*"))
+((COUNTIF(Mon!$B$42:$B$47,A4)*$B$2)/COUNTIF(Mon!$B$39:$B$40,"*")/COUNTIF(Mon!$B$42:$B$47,"*"))
+((COUNTIF(Mon!$B$42:$B$47,A4)*$B$2)/COUNTIF(Mon!$B$39:$B$40,"*")/COUNTIF(Mon!$B$42:$B$47,"*"))...
Sometimes certain activity blocks will be empty and others, which were empty, filled in. I want this formula to give me the results without having to change it all the time.
So what I would like Excel to do is ignore one range of cells if it is blank, but still continue to add up the others which are not blank.
Is this achievable?