Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7
Default Advanced Array Formula Problem

In the spreadsheet that I'm working on, I'm having to use the following array
formula:

{=SUM(IF(('Data Entry'!$A$2:$A$92='Comparitive Chart'!E$1)*('Data
Entry'!$B$2:$B$92='Comparitive Chart'!$C13),1))}

While this works as desired, the problem is that there may be more than 91
entries on the 'Data Entry' page. If I changed it to look at $A:$A instead
of $A$2:$A$92, then the formula returns an error because of all the unused,
blank cells.

I guess what I need is a way to have the formula dynamically look at only
the cells that actually have values, and ignore the rest. There will be no
empty cells in the middle of the list, they will all be at the bottom of the
spreadsheet.

I initially thought to change the formula to look at a cell that counted the
non-blanks by using counta() by changing the formula to read like this(the
referenced cell is z1)

{=SUM(IF(('Data Entry'!$A$2:address($z$1,1)='Comparitive Chart'!E$1)*('Data
Entry'!$B$2:address($z$1,2)='Comparitive Chart'!$C13),1))}

Of course, this didn't work either.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,231
Default Advanced Array Formula Problem

Magius96 wrote...
In the spreadsheet that I'm working on, I'm having to use the
following array formula:

{=SUM(IF(('Data Entry'!$A$2:$A$92='Comparitive Chart'!E$1)
*('Data Entry'!$B$2:$B$92='Comparitive Chart'!$C13),1))}


This could be replaced by the nonarray formula

=SUMPRODUCT(('Data Entry'!$A$2:$A$92='Comparitive Chart'!E$1)
*('Data Entry'!$B$2:$B$92='Comparitive Chart'!$C13))

While this works as desired, the problem is that there may be more
than 91 entries on the 'Data Entry' page. If I changed it to look at
$A:$A instead of $A$2:$A$92, then the formula returns an error
because of all the unused, blank cells.

....

No, it returns an error because Excel 2003 and prior can't handle
arrays that reach 65536 rows. Excel has no trouble whatsoever with
blank cells.

Since you're not using row 1 in the original formula, do you need to
include it in your new formula? If not, try

=SUMPRODUCT(('Data Entry'!$A$2:$A$65536='Comparitive Chart'!E$1)
*('Data Entry'!$B$2:$B$65536='Comparitive Chart'!$C13))

which should work, but it'll be SLOW. While you may need more than 91
rows, would you really need more than, say, 1000 rows? If not, just
use 1000 rows.

If you have widely varying numbers of rows, try a 2-cell approach.
Name the first LastRow and enter the following formula in it.

=LOOKUP(2,1/('Data Entry'!$A$2:$A$65536<"")
/('Data Entry'!$B$2:$B$65536<""),ROW('Data Entry'!$B$2:$B$65536)-1)

Then try the formula

=SUMPRODUCT(('Data Entry'!$A$2:
INDEX('Data Entry'!$A$2:$A$65536,LastRow)='Comparitive Chart'!E$1)
*('Data Entry'!$B$2:INDEX('Data Entry'!$B$2:$B$65536,LastRow)
='Comparitive Chart'!$C13))

. . . There will be no empty cells in the middle of the list, they
will all be at the bottom of the spreadsheet.

....

That's a poor design for a spreadsheet.
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
Array formula problem Constance Excel Discussion (Misc queries) 3 August 22nd 06 06:03 PM
Problem w/Array Formula danw Excel Worksheet Functions 2 August 1st 06 10:55 PM
Array Formula Problem rmolitor Excel Worksheet Functions 4 December 2nd 05 06:35 PM
array formula problem bill gras Excel Worksheet Functions 6 September 28th 05 04:54 AM
problem with Array Formula OrdOff Excel Worksheet Functions 2 June 30th 05 04:57 PM


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