Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 14
Default Using NAMES in SUMPRODUCT giving error

I had just posted a question that was answered, so I tried to make it easier
to understand the formula for whomever takes over for me and defined the
columns as REDCAT, Gender, and Grade doing InsertNameDefine.

The formula works fine like this:
=SUMPRODUCT(--('By-Name Population'!D2:D4000="WHITE"),--('By-Name
Population'!E2:E4000="M"),--('By-Name Population'!F2:F4000="Jr NCO"))

But when I tried to replace the cell ranges with the names I defined:
=SUMPRODUCT(--(REDCAT="WHITE"),--(Gender="M"),--(Grade="Jr NCO"))

I get a #NUM error. Am I not using the Name correctly? I've even tried when
I'm using the formula to InsertNamePaste and it doesn't work. Is it because
the data is on another worksheet? I really need it to look at the entire
column because it could expand.

Thanks for the help!

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Using NAMES in SUMPRODUCT giving error

If you're using xl2007, then you can use the entire column.

If you're using xl2003 or below, then you can't.

Maybe you can use all the rows but one.

or maybe you can use a dynamic range that changes with the amount of data.

Debra Dalgleish explains dynamic range names he
http://contextures.com/xlNames01.html#Dynamic

SFC Traver wrote:

I had just posted a question that was answered, so I tried to make it easier
to understand the formula for whomever takes over for me and defined the
columns as REDCAT, Gender, and Grade doing InsertNameDefine.

The formula works fine like this:
=SUMPRODUCT(--('By-Name Population'!D2:D4000="WHITE"),--('By-Name
Population'!E2:E4000="M"),--('By-Name Population'!F2:F4000="Jr NCO"))

But when I tried to replace the cell ranges with the names I defined:
=SUMPRODUCT(--(REDCAT="WHITE"),--(Gender="M"),--(Grade="Jr NCO"))

I get a #NUM error. Am I not using the Name correctly? I've even tried when
I'm using the formula to InsertNamePaste and it doesn't work. Is it because
the data is on another worksheet? I really need it to look at the entire
column because it could expand.

Thanks for the help!


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 48
Default Using NAMES in SUMPRODUCT giving error

I hope this will help...
I don't think SUMPRODUCT can reference whole columns. A solution to the
problem regarding expansion would be to use dynamically named ranges which
will expand whenever a user puts a value into the next empty cell in a range.

You can enter them by going to InsertNameDefine and entering the formulas
below. You will need to handle text and number entries differently so I'll
provide both formulas and reference a website.

For number values
=OFFSET(Sheet1!$H$2,0,0,MATCH(1E+306,Sheet1!$H:$H, 1),1)
for text values
=OFFSET(Sheet1!$C$2,0,0,MATCH("*",Sheet1!$C:$C,-1),1)

These examples assume a header row so without a header row you would change
$C$2 to $C$1, etc.

OzGrid has an excellent explanation with plenty of examples at this URL
http://www.ozgrid.com/Excel/advanced-dynamic-ranges.htm

Thanks for your service, Sergeant

Stephen

"SFC Traver" wrote:

I had just posted a question that was answered, so I tried to make it easier
to understand the formula for whomever takes over for me and defined the
columns as REDCAT, Gender, and Grade doing InsertNameDefine.

The formula works fine like this:
=SUMPRODUCT(--('By-Name Population'!D2:D4000="WHITE"),--('By-Name
Population'!E2:E4000="M"),--('By-Name Population'!F2:F4000="Jr NCO"))

But when I tried to replace the cell ranges with the names I defined:
=SUMPRODUCT(--(REDCAT="WHITE"),--(Gender="M"),--(Grade="Jr NCO"))

I get a #NUM error. Am I not using the Name correctly? I've even tried when
I'm using the formula to InsertNamePaste and it doesn't work. Is it because
the data is on another worksheet? I really need it to look at the entire
column because it could expand.

Thanks for the help!

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
Another SUMPRODUCT giving the incorrect number Richard Excel Discussion (Misc queries) 11 June 22nd 07 03:50 PM
SUMPRODUCT is giving incorrect number Richard Excel Discussion (Misc queries) 2 June 22nd 07 11:17 AM
SUMPRODUCT - Giving me trouble porter444 Excel Worksheet Functions 3 May 22nd 07 11:04 AM
Sumproduct giving #NA Gary Excel Worksheet Functions 2 August 3rd 06 11:47 AM
Function giving Error Martin Excel Worksheet Functions 3 October 1st 05 03:49 AM


All times are GMT +1. The time now is 08:38 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"