Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Martin B
 
Posts: n/a
Default Sum data based on 2 criteria

Hi Group

Hope you can help with this and appologies if its already been covered but I have a spreadsheet used to record the output from 4 production shifts over a number of weeks

Col A = week number
Col B = team (A,B,C,D)
Col C = Units per hour produced

The columns are named ranges i.e Col A is called "weeknum", Col B is called "Team" and Col C is called "unitsperhour"

What I need to be able to do is find the average number of units per hour for a given team and a given week so I think I'm after something along the lines of

countif(weeknum=10)and(team=B) to find the number of entries for team B in wk 10 and
sumif(weeknum=10)and(team=B),unitsperhour to add all the entries for team B in wk 10 to allow the average to be calculated.

Hope thats clear enough

Thanks in anticipation

Martin Bagshaw

  #2   Report Post  
Ron de Bruin
 
Posts: n/a
Default

Hi Martin

You can use Sumproduct

Start here
http://www.xldynamic.com/source/xld.SUMPRODUCT.html



--
Regards Ron de Bruin
http://www.rondebruin.nl


"Martin B" wrote in message ...
Hi Group

Hope you can help with this and appologies if its already been covered but I have a spreadsheet used to record the output from 4 production shifts over a number of weeks

Col A = week number
Col B = team (A,B,C,D)
Col C = Units per hour produced

The columns are named ranges i.e Col A is called "weeknum", Col B is called "Team" and Col C is called "unitsperhour"

What I need to be able to do is find the average number of units per hour for a given team and a given week so I think I'm after something along the lines of

countif(weeknum=10)and(team=B) to find the number of entries for team B in wk 10 and
sumif(weeknum=10)and(team=B),unitsperhour to add all the entries for team B in wk 10 to allow the average to be calculated.

Hope thats clear enough

Thanks in anticipation

Martin Bagshaw

  #3   Report Post  
Ragdyer
 
Posts: n/a
Default

Do you actually need the number of entries, or did you ask for that number
just to be able to calculate the average?

Anyway, with the "WeekNum" to lookup entered in E1,
And the "Team" to lookup entered in F1,
Try these:

Number of entries for team for weeknum:
=SUMPRODUCT((weeknum=E1)*(team=F1))

Total units for team for weeknum:
=SUMPRODUCT((weeknum=E1)*(team=F1)*unitsperhour)

Average of units for team for weeknum:
=SUMPRODUCT((weeknum=E1)*(team=F1)*unitsperhour)/SUMPRODUCT((weeknum=E1)*(te
am=F1))

--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------



"Martin B" wrote in message
...
Hi Group

Hope you can help with this and appologies if its already been covered but I
have a spreadsheet used to record the output from 4 production shifts over a
number of weeks

Col A = week number
Col B = team (A,B,C,D)
Col C = Units per hour produced

The columns are named ranges i.e Col A is called "weeknum", Col B is called
"Team" and Col C is called "unitsperhour"

What I need to be able to do is find the average number of units per hour
for a given team and a given week so I think I'm after something along the
lines of

countif(weeknum=10)and(team=B) to find the number of entries for team B in
wk 10 and
sumif(weeknum=10)and(team=B),unitsperhour to add all the entries for team B
in wk 10 to allow the average to be calculated.

Hope thats clear enough

Thanks in anticipation

Martin Bagshaw


  #4   Report Post  
Martin B
 
Posts: n/a
Default


Thanks for responding but I can't get the formula to work, keep getting a
#NUM error message telling me the cell I am referring to containing the week
number contains a constant. Any ideas?

Martin


  #5   Report Post  
Bob Phillips
 
Posts: n/a
Default

Martin,

Do your named ranges refer to whole columns? If so, there is your problem as
SUMPRODUCT cannot handle whole columns, only part columns.

Also Weeknum doesn't seem like a smart name for a range, it is an Analysis
Toolpak function.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Martin B" wrote in message
...

Thanks for responding but I can't get the formula to work, keep getting a
#NUM error message telling me the cell I am referring to containing the

week
number contains a constant. Any ideas?

Martin




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to move data to different column based on data in another co malycom Excel Discussion (Misc queries) 3 August 2nd 05 07:07 PM
Adding total dollars based on specific data from another column Espo Excel Discussion (Misc queries) 1 June 13th 05 07:52 PM
Getting data from another workbook based on variable joemc911 Excel Discussion (Misc queries) 3 May 25th 05 09:18 AM
How do I validate data using different lists based on the data in. Shannon Excel Discussion (Misc queries) 1 March 28th 05 05:55 PM
Importing Data Into Formula Based Cells Heyna Excel Worksheet Functions 1 November 4th 04 06:04 PM


All times are GMT +1. The time now is 05:20 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"