Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Daniel Bonallack
 
Posts: n/a
Default SUMPRODUCT question

I have 50 worksheets (one for each US state). Each has three columns -
salesperson, year and sales.

On a new tab, I have in A2:A51 the 50 states. In cells B1:E1 I have the
years 2001, 2002, 2003, 2004.

I want to know the sales, per year for John Doe, in each of the states. I
have range names set up in each of the 50 tabs (done with a macro).

In cell B2 I have the formula =SUMPRODUCT((rPersonAlaska="John
Doe")*(rYearAlaska=B$1)*rSalesAlaska)

This of course works for Alaska, but how can I make the formula cleverly
refer to the state names in column A?

Sorry this is complicated - thanks for any help

Daniel
  #2   Report Post  
Barb
 
Posts: n/a
Default

Hi Daniel
How about if you had one sheet with all that data plus one more column for
"State".Then you can just run a pivot table against it. It would give you
much more flexibility with any reports.

Barb

"Daniel Bonallack" wrote:

I have 50 worksheets (one for each US state). Each has three columns -
salesperson, year and sales.

On a new tab, I have in A2:A51 the 50 states. In cells B1:E1 I have the
years 2001, 2002, 2003, 2004.

I want to know the sales, per year for John Doe, in each of the states. I
have range names set up in each of the 50 tabs (done with a macro).

In cell B2 I have the formula =SUMPRODUCT((rPersonAlaska="John
Doe")*(rYearAlaska=B$1)*rSalesAlaska)

This of course works for Alaska, but how can I make the formula cleverly
refer to the state names in column A?

Sorry this is complicated - thanks for any help

Daniel

  #3   Report Post  
Daniel Bonallack
 
Posts: n/a
Default

A good suggestion, that made me realize I'd forgotten to mention and
important piece of information. Each worksheet has about 30,000 rows of
data. No chance to bring them together.

Daniel

"Barb" wrote:

Hi Daniel
How about if you had one sheet with all that data plus one more column for
"State".Then you can just run a pivot table against it. It would give you
much more flexibility with any reports.

Barb

"Daniel Bonallack" wrote:

I have 50 worksheets (one for each US state). Each has three columns -
salesperson, year and sales.

On a new tab, I have in A2:A51 the 50 states. In cells B1:E1 I have the
years 2001, 2002, 2003, 2004.

I want to know the sales, per year for John Doe, in each of the states. I
have range names set up in each of the 50 tabs (done with a macro).

In cell B2 I have the formula =SUMPRODUCT((rPersonAlaska="John
Doe")*(rYearAlaska=B$1)*rSalesAlaska)

This of course works for Alaska, but how can I make the formula cleverly
refer to the state names in column A?

Sorry this is complicated - thanks for any help

Daniel

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

Daniel,

Try this

=SUMPRODUCT((INDIRECT("rPerson"&A1)="John
Doe")*(INDIRECT("rYear"&A1)=B$1),INDIRECT("rSales" &A1))

--

HTH

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


"Daniel Bonallack" wrote in
message ...
I have 50 worksheets (one for each US state). Each has three columns -
salesperson, year and sales.

On a new tab, I have in A2:A51 the 50 states. In cells B1:E1 I have the
years 2001, 2002, 2003, 2004.

I want to know the sales, per year for John Doe, in each of the states. I
have range names set up in each of the 50 tabs (done with a macro).

In cell B2 I have the formula =SUMPRODUCT((rPersonAlaska="John
Doe")*(rYearAlaska=B$1)*rSalesAlaska)

This of course works for Alaska, but how can I make the formula cleverly
refer to the state names in column A?

Sorry this is complicated - thanks for any help

Daniel



  #5   Report Post  
Daniel Bonallack
 
Posts: n/a
Default

Bob, thanks a lot.

Daniel

"Barb" wrote:

Hi Daniel
How about if you had one sheet with all that data plus one more column for
"State".Then you can just run a pivot table against it. It would give you
much more flexibility with any reports.

Barb

"Daniel Bonallack" wrote:

I have 50 worksheets (one for each US state). Each has three columns -
salesperson, year and sales.

On a new tab, I have in A2:A51 the 50 states. In cells B1:E1 I have the
years 2001, 2002, 2003, 2004.

I want to know the sales, per year for John Doe, in each of the states. I
have range names set up in each of the 50 tabs (done with a macro).

In cell B2 I have the formula =SUMPRODUCT((rPersonAlaska="John
Doe")*(rYearAlaska=B$1)*rSalesAlaska)

This of course works for Alaska, but how can I make the formula cleverly
refer to the state names in column A?

Sorry this is complicated - thanks for any help

Daniel

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
2 part question on averaging Geo Excel Discussion (Misc queries) 4 January 2nd 05 10:35 PM
Sumproduct ... Empty Cells vs Spaces? Ken Excel Discussion (Misc queries) 9 December 17th 04 08:03 PM
adding two sumproduct formulas together ski2004_2005 Excel Worksheet Functions 1 November 12th 04 09:08 PM
Sumproduct in Excel Spreadsheet to read Access db table Jules Excel Worksheet Functions 1 November 9th 04 02:50 PM
SUMPRODUCT using offset from ROW if X marks the spot The Shaffer s Excel Worksheet Functions 3 November 2nd 04 06:14 AM


All times are GMT +1. The time now is 04:12 PM.

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

About Us

"It's about Microsoft Excel"