Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Another SUMPRODUCT giving the incorrect number | Excel Discussion (Misc queries) | |||
SUMPRODUCT is giving incorrect number | Excel Discussion (Misc queries) | |||
SUMPRODUCT - Giving me trouble | Excel Worksheet Functions | |||
Sumproduct giving #NA | Excel Worksheet Functions | |||
Function giving Error | Excel Worksheet Functions |