Home |
Search |
Today's Posts |
|
#1
![]() |
|||
|
|||
![]()
* The value in cell A1 varies depending on the number of rows of data brought
down in a query * I have used the 'NAME' function to name cell A1 '_DataRows' I now want to use '_DataRows' to identify the end of a range in a SUMPRODUCT formula. (i.e. a formula something like this...) =SUMPRODUCT (--($D$1:$D$"_DataRows"=XYZ),--($D$1:$D"_DataRows"<""),--($E$1:$E"_DataRows")) How do I do this (see examples below). Many Thanks, Craig ------------------------------------------- Example 1: --------------- If cell A1 = 25 Formula in cell B2: =SUMPRODUCT (--($D$1:$D$25=XYZ),--($D$1:$D$25<""),--($E$1:$E$25)) Example 2: --------------- If cell A1 = 38 Formula in cell B2: =SUMPRODUCT (--($D$1:$D$38=XYZ),--($D$1:$D$38<""),--($E$1:$E$38)) |
#2
![]() |
|||
|
|||
![]()
Change each portion to something like:
=sumproduct(--(INDIRECT("$D$1:$D$" & _datarows)=XYZ), .... If you query would return 400 lines at most, why not just use $d$1:D$1000? (choose a number that's big enough to never be exceeded--but don't use the whole column) cdavidson wrote: * The value in cell A1 varies depending on the number of rows of data brought down in a query * I have used the 'NAME' function to name cell A1 '_DataRows' I now want to use '_DataRows' to identify the end of a range in a SUMPRODUCT formula. (i.e. a formula something like this...) =SUMPRODUCT (--($D$1:$D$"_DataRows"=XYZ),--($D$1:$D"_DataRows"<""),--($E$1:$E"_DataRows")) How do I do this (see examples below). Many Thanks, Craig ------------------------------------------- Example 1: --------------- If cell A1 = 25 Formula in cell B2: =SUMPRODUCT (--($D$1:$D$25=XYZ),--($D$1:$D$25<""),--($E$1:$E$25)) Example 2: --------------- If cell A1 = 38 Formula in cell B2: =SUMPRODUCT (--($D$1:$D$38=XYZ),--($D$1:$D$38<""),--($E$1:$E$38)) -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Match function...random search? | Excel Worksheet Functions | |||
How to Select a relative range with Using "Find" and Offset() | Excel Discussion (Misc queries) | |||
Offset Function works in cell, not in named range | Excel Worksheet Functions | |||
Reference the worksheet from a multiple worksheet range function ( | Excel Worksheet Functions | |||
How do I reference and sort a range of numbers in Excel 97? | Excel Worksheet Functions |