Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Cell Reference issue


I have a formula:
=SUMPRODUCT(SUBTOTAL(3,OFFSET(Sheet1!N:N,ROW(Sheet 1!N2:N65536)
-ROW(Sheet1!N1),0,1)),--(Sheet1!N2:N65536="Dog"))

Calculating the sheet takes forever because of the cell range.
Sometime the sheet will have 10 rows other times it will have 10,000
rows, so I put the range N2:N65536. I already have a count of the
number of rows in a cell. Can I refer to that cell in the range, for
example: N2:N&B1 (where B1 has the number of rows)?

I tried it a ton of ways but can't get it to work. Any input would be
appreciated.



--
KMartin
------------------------------------------------------------------------
KMartin's Profile: http://www.excelforum.com/member.php...o&userid=37164
View this thread: http://www.excelforum.com/showthread...hreadid=568826

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Cell Reference issue


The most efficient way would probably be

N2:INDEX(N:N,B1)

You could also use

=INDIRECT("N2:N"&B1)


--
daddylonglegs
------------------------------------------------------------------------
daddylonglegs's Profile: http://www.excelforum.com/member.php...o&userid=30486
View this thread: http://www.excelforum.com/showthread...hreadid=568826

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Cell Reference issue


Thank you...using N2:INDEX(N:N,B1) definitely has me on the right track.


I am getting a #Value! error, but when I evaluate the error the cell
reference is showing the range I want.


--
KMartin
------------------------------------------------------------------------
KMartin's Profile: http://www.excelforum.com/member.php...o&userid=37164
View this thread: http://www.excelforum.com/showthread...hreadid=568826

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Cell Reference issue


One more question...

I think my error is because I am referencing another sheet in the
workbook. If I move my formula over to Sheet1, it seems to work fine.
I know I read something about getting the error if you reference a
closed workbook, but both sheets are in the same workbook. Do I need
to refer to Sheet1 or Sheet2 differently?

=SUMPRODUCT(SUBTOTAL(3,OFFSET(Sheet1!N:N,ROW(Sheet 1!N2:INDEX($N:$N,Sheet2B1))-ROW(Sheet1!N1),0,1)),--(Sheet1!N2:INDEX($N:$N,Sheet2!B1)="High"))


--
KMartin
------------------------------------------------------------------------
KMartin's Profile: http://www.excelforum.com/member.php...o&userid=37164
View this thread: http://www.excelforum.com/showthread...hreadid=568826

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Cell Reference issue


If the formula isn't in sheet1 then I think you need "sheet1!" before
the $N:$N, i.e.

=SUMPRODUCT(SUBTOTAL(3,OFFSET(Sheet1!N:N,ROW(Sheet 1!N2:INDEX(Sheet1!$N:$N,Sheet2!B1))-ROW(Sheet1!N1),0,1)),--(Sheet1!N2:INDEX(Sheet1!$N:$N,Sheet2!B1)="High"))


--
daddylonglegs
------------------------------------------------------------------------
daddylonglegs's Profile: http://www.excelforum.com/member.php...o&userid=30486
View this thread: http://www.excelforum.com/showthread...hreadid=568826



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Cell Reference issue


Worked like a charm - Pure Genius! Thank you very much!


--
KMartin
------------------------------------------------------------------------
KMartin's Profile: http://www.excelforum.com/member.php...o&userid=37164
View this thread: http://www.excelforum.com/showthread...hreadid=568826

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 733
Default Cell Reference issue

daddylonglegs wrote...
If the formula isn't in sheet1 then I think you need "sheet1!" before
the $N:$N, i.e.

=SUMPRODUCT(SUBTOTAL(3,OFFSET(Sheet1!N:N,ROW(Shee t1!N2:INDEX(Sheet1!$N:$N,
Sheet2!B1))-ROW(Sheet1!N1),0,1)),--(Sheet1!N2:INDEX(Sheet1!$N:$N,Sheet2!B1)="High"))


This particular formula is equivalent to

=COUNTIF(Sheet1!N:N,"High")

which is nonvolatile. It's highly likely this COUNTIF formula would be
even more efficient.

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
Nesting a sheet name reference within a cell reference??? Broyston Excel Discussion (Misc queries) 9 July 8th 08 08:35 PM
How do I anchor a cell reference? CasaJay Excel Discussion (Misc queries) 3 June 7th 06 07:12 AM
Reference Cell Color From Other WorkSheets carCiNogn Excel Worksheet Functions 1 May 17th 06 09:35 PM
Urgent date/scheduling calc needed jct Excel Worksheet Functions 3 February 24th 06 01:36 AM
Possible Lookup Table Karen Excel Worksheet Functions 5 June 8th 05 09:43 PM


All times are GMT +1. The time now is 03:40 AM.

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"