Calculate Formulas with Visible Rows Only

resourceguru

New Member
Joined
Jan 15, 2019
Messages
6
Hello,

I'm designing a resourcing spreadsheet and am trying to customize the formulas so it only calculates numbers for the rows that are filtered out/visible. From somewhat similar posts, it seems like I should do something with the sumifs and function 9. I got stuck after dealing with the offset components.

For context:
  • Ultimately, I want the resourcing graph to update based on which resource I've selected.
  • To do that, I want to update the formulas so that they are dependent on which resource I've selected/filtered out--i.e., only the rows that are visible
Current state:
  • Right now, I have formulas that only makes calculations based on certain criteria.
  • E.g., SUMIFS(H:H,$B:$B,"Sold",$E:$E,"FTE")/5 is used to sum all the resource days on col H if the person is FTE and doing sold work, then divide by 5 to convert that number into headcounts for that week.
Next Steps:
  • I want to customize that formula so that it only makes the calculations for resources I've selected/filtered out.
  • How should I proceed with this challenge? In case it helps, I've uploaded a sample spreadsheet to get that basic formula down before applying it to the other calculations
  • Spreadsheet link:
https://drive.google.com/open?id=1SijEScMNZmOOQ7cbsyJ9Uh8CnJAKQwfa

Thanks in advance!
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
To clarify: the resources in question that I want to filter is Col C ("Name"). So what I'm trying to do will be: calculate the headcoutns doing sold work for each week--for only Bob!
 
Upvote 0
Try this with Ctrl+Shift+Enter in H7:

Code:
=SUMPRODUCT((IF(SUBTOTAL(3,OFFSET(B3,ROW($B3:$B5)-ROW($B3),,1,)),$B3:$B5)="Sold")*H3:H5)/5

Copy the formula down and across.
 
Upvote 0

Book1
ABCDEFGHIJK
118-Jan25-Jan1-Feb8-Feb
2ProjectsProject StatusNameRoleEmployee Status
3Project ASoldBobEngineerFTE3235
4Project BSoldRonDesignerFTE5323
5Project CPlannedSeithPMFTE1235
6
7
8Headcounts Doing Sold Work for Each Week1.6111.6
9
Sheet1
Cell Formulas
RangeFormula
H8{=SUMPRODUCT((IF(SUBTOTAL(3,OFFSET(B3,ROW($B3:$B5)-ROW($B3),,1,)),$B3:$B5)="Sold")*H3:H5)/5}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
ABCDEFGHIJK
118-Jan25-Jan1-Feb8-Feb
2ProjectsProject StatusNameRoleEmployee Status
3Project ASoldBobEngineerFTE3235
4Project BSoldRonDesignerFTE5323
5Project CPlannedSeithPMFTE1235
6
7
8Headcounts Doing Sold Work for Each Week1.6111.6
9

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet1

Array Formulas
CellFormula
H8{=SUMPRODUCT((IF(SUBTOTAL(3,OFFSET(B3,ROW($B3:$B5)-ROW($B3),,1,)),$B3:$B5)="Sold")*H3:H5)/5}

<thead>
</thead><tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself

<tbody>
</tbody>

Thanks! I it works with the sample data. How do I apply it so that it accounts for the Employee Status condition as well? E.g., not everyone is FTE, some will be contractor. This is why the current formula contains $E:$E,"FTE", which makes sure that I only add the data if the person is doing sold work AND is an FTE.
 
Upvote 0

Book1
ABCDEFGHIJK
118-Jan25-Jan1-Feb8-Feb
2ProjectsProject StatusNameRoleEmployee Status
3Project ASoldBobEngineerFTE3235
4Project BSoldRonDesignerFTE5323
5Project CPlannedSeithPMFTE1235
6
7
8Headcounts Doing Sold Work for Each Week1.6111.6
9
Sheet1
Cell Formulas
RangeFormula
H8{=SUMPRODUCT((IF(SUBTOTAL(3,OFFSET(B3,ROW($B3:$B5)-ROW($B3),,1,)),$B3:$B5&$E3:$E5)="SoldFTE")*H3:H5)/5}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Last edited:
Upvote 0
Thanks Nishant94!

I tested it on the broader spreadsheet and it works pretty well. I did have to add a "$" to B3 so that value remains static when applying formulas to the subsequent columns.

I.e., from:
SUMPRODUCT((IF(SUBTOTAL(3,OFFSET(B3,ROW($B3:$B5)-ROW($B3),,1,)),$B3:$B5&$E3:$E5)="SoldFTE")*H3:H5)/5
to:
SUMPRODUCT((IF(SUBTOTAL(3,OFFSET($B3,ROW($B3:$B5)-ROW($B3),,1,)),$B3:$B5&$E3:$E5)="SoldFTE")*H3:H5)/5

This will take the resourcing sheet design to the next level. :)
 
Upvote 0

Forum statistics

Threads
1,214,593
Messages
6,120,434
Members
448,961
Latest member
nzskater

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