View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
macropod
 
Posts: n/a
Default Sumproduct (Range unknown, needs Search)

hi Ricky,

You could try:
=SUMPRODUCT(--(Sheet1!$A$1:OFFSET($A$1,COUNTA(A:A)-1,0)=TRIM($A1)),(Sheet1!B
$1:OFFSET($B$1,COUNTA(A:A)-1,0)))
but this will only be reliable if all rows down to the last row in column A
are populated.

Cheers


"ExcelQuestion"
wrote in message
news:ExcelQuestion.2778jm_1146605101.7257@excelfor um-nospam.com...

Hello,
My current formula down column B is
=SUMPRODUCT(--(Sheet1!$A$1:$A$100=TRIM($A1)),(Sheet1!B$1:B$100))

My data in Sheet1 changes regularly so I'd need the ending range to
expand or compress depending on where the last row of "Net Income" is
situated. For example, if "Net Income" is on row 90; then, the end
range should be updated automatically to be $A$1:$A$90 so it doesn't
pick up totals past the "Net Income" rows.

How do you add a search function so that the $A$100 row changes
according to the new row wherever "Net Income" moves to?

Thanks,
Ricky


--
ExcelQuestion
------------------------------------------------------------------------
ExcelQuestion's Profile:

http://www.excelforum.com/member.php...o&userid=34059
View this thread: http://www.excelforum.com/showthread...hreadid=538233