sum of values on page only if the value in a column is within a named range

RyanRothchild

New Member
Joined
May 1, 2014
Messages
1
For your consideration and appreciated assistance:

In MS Excel 2010

In my workbook, I have multiple named ranges containing the Identification codes for sub-organizations (companies) within my units (battalions). Each named range contains five to seven company ID codes per battalion. I also have multiple sheets containing different queries for records of activity within those organizations. One such page returns the status of schedules submitted for approval by each company. Column D contains the time period for the schedule by listing the week number in the fiscal year. Column F contains the status of the schedule (approved, disapproved, pending approval, etc.) Column G contains the Identificaiton Code for the unit. These ID codes have been grouped into named ranges that represent their parent batallion organization. For example, the GUNNER batallion contains ID Codes UA0, UB0, UT0, and RG0 representing the four companies in that batallion. Each company is required to submit a schedule for approval for each week (time period).

On the first page, I have generated a roll-up that should calculate the total number of approved schedules for each battalion in a given time period.

I need a formula that will count all the records in the worksheet only if the value in column G falls in a certain battalion named range, and the value in column D is the specifid time period, and the value in column F is "approved."

So far, I have come up with this, and it doesn't work:

=COUNTIFS(COTNGSCHD!$G:$G,GUNNER,COTNGSCHD!$D:$D,$B4,COTNGSCHD!$F:$F,"APPROVED")

where COTNGSCHD is the sheet name that contains the data, GUNNER is the named range for the Battalion, and $B4 is the cell on the rollup sheet in which I specify the time period.

What am I doing wrong and how can I fix my rollup formula.
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Possibly something like this:
=IF(ISERROR(VLOOKUP($G4,GUNNER,1,FALSE)),"",COUNTIFS(COTNGSCHD!$G:$G,GUNNER,COTNGSCHD!$D:$D,$B4,COTNGSCHD!$F:$F,"APPROVED"))
Returns "" if G$ is not in GUNNER, and the COUNTIFS if it is.

You may want to assign a max value for the rows unless you really could reach 1 million plus records. $x2:$x10000 instead of $x:$x
 
Upvote 0

Forum statistics

Threads
1,223,910
Messages
6,175,318
Members
452,634
Latest member
cpostell

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