Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 44
Default Using SUM + INDEX in array formula

I'm having problems getting an array formula like this to work:
=SUM(INDEX(Data_Table,Row_Index_List,Col_Index_Lis t))

Basically, I have two columns of numbers that represent the row and column
indexes from a data table (ranges Row_Index_List and Col_Index_List). I want
to look up the numbers in the corresponding row/column of range Data_Table,
and return the sum of all returned values.

More detail: Row_Index_List and Col_Index_List are columns of (let's say)
100 cells, and Data_Table is a 7*5 range on the same sheet.

It looks like the combination of SUM(INDEX(..)) does not work in an array
formula. Can anyone suggest anything different. I have tried combinations of
SUMIF, OFFSET, INDIRECT, SUMPRODUCT, but none seem to work. SUMIF gets close,
but seems to return an array that is offset from the result I would expect.

Thanks,
Dave
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 457
Default Using SUM + INDEX in array formula

To clarify, you're essentially wanting to perform 100 INDEX functions based
on the two columns, and SUM all the results?

My first question would be, why can't you just use a helper column to
perform this step, and then SUM that?

--
Best Regards,

Luke M
"Dave Ramage" wrote in message
...
I'm having problems getting an array formula like this to work:
=SUM(INDEX(Data_Table,Row_Index_List,Col_Index_Lis t))

Basically, I have two columns of numbers that represent the row and column
indexes from a data table (ranges Row_Index_List and Col_Index_List). I
want
to look up the numbers in the corresponding row/column of range
Data_Table,
and return the sum of all returned values.

More detail: Row_Index_List and Col_Index_List are columns of (let's say)
100 cells, and Data_Table is a 7*5 range on the same sheet.

It looks like the combination of SUM(INDEX(..)) does not work in an array
formula. Can anyone suggest anything different. I have tried combinations
of
SUMIF, OFFSET, INDIRECT, SUMPRODUCT, but none seem to work. SUMIF gets
close,
but seems to return an array that is offset from the result I would
expect.

Thanks,
Dave



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,520
Default Using SUM + INDEX in array formula

Hi Dave

Try the below

A1:A3 = row index
B1:B3 = col index

Col A Col B
1 4
2 5
3 6

The below should sum up cells D1,E2 and F3...

=SUMPRODUCT(SUM(OFFSET(A1,(A1:A3)-1,(B1:B3)-1)))

--
Jacob (MVP - Excel)


"Dave Ramage" wrote:

I'm having problems getting an array formula like this to work:
=SUM(INDEX(Data_Table,Row_Index_List,Col_Index_Lis t))

Basically, I have two columns of numbers that represent the row and column
indexes from a data table (ranges Row_Index_List and Col_Index_List). I want
to look up the numbers in the corresponding row/column of range Data_Table,
and return the sum of all returned values.

More detail: Row_Index_List and Col_Index_List are columns of (let's say)
100 cells, and Data_Table is a 7*5 range on the same sheet.

It looks like the combination of SUM(INDEX(..)) does not work in an array
formula. Can anyone suggest anything different. I have tried combinations of
SUMIF, OFFSET, INDIRECT, SUMPRODUCT, but none seem to work. SUMIF gets close,
but seems to return an array that is offset from the result I would expect.

Thanks,
Dave

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,520
Default Using SUM + INDEX in array formula

Dave, the earlier one work on the row number...If you have row/col "indexes"
try the below version..

=SUMPRODUCT(SUM(OFFSET(INDIRECT(CELL("address",Dat a_Table)),(Row_Index_List)-1,(Col_Index_List)-1)))

--
Jacob (MVP - Excel)


"Jacob Skaria" wrote:

Hi Dave

Try the below

A1:A3 = row index
B1:B3 = col index

Col A Col B
1 4
2 5
3 6

The below should sum up cells D1,E2 and F3...

=SUMPRODUCT(SUM(OFFSET(A1,(A1:A3)-1,(B1:B3)-1)))

--
Jacob (MVP - Excel)


"Dave Ramage" wrote:

I'm having problems getting an array formula like this to work:
=SUM(INDEX(Data_Table,Row_Index_List,Col_Index_Lis t))

Basically, I have two columns of numbers that represent the row and column
indexes from a data table (ranges Row_Index_List and Col_Index_List). I want
to look up the numbers in the corresponding row/column of range Data_Table,
and return the sum of all returned values.

More detail: Row_Index_List and Col_Index_List are columns of (let's say)
100 cells, and Data_Table is a 7*5 range on the same sheet.

It looks like the combination of SUM(INDEX(..)) does not work in an array
formula. Can anyone suggest anything different. I have tried combinations of
SUMIF, OFFSET, INDIRECT, SUMPRODUCT, but none seem to work. SUMIF gets close,
but seems to return an array that is offset from the result I would expect.

Thanks,
Dave

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 44
Default Using SUM + INDEX in array formula

Luke- agreed, a helper column would be the easy option, but I always like to
do a calculation in one cell if at all possible- after all, an extra column
is just an array of values, so why can't this be included in a single cell
formula.

Obviously the formula gets more complicated and more difficult for others to
modify later, but for me the advantage of neater data presentation without
having to hide columns is more important.

Thanks to Jacob's reply, it is possible!




"Luke M" wrote:

To clarify, you're essentially wanting to perform 100 INDEX functions based
on the two columns, and SUM all the results?

My first question would be, why can't you just use a helper column to
perform this step, and then SUM that?

--
Best Regards,

Luke M
"Dave Ramage" wrote in message
...
I'm having problems getting an array formula like this to work:
=SUM(INDEX(Data_Table,Row_Index_List,Col_Index_Lis t))

Basically, I have two columns of numbers that represent the row and column
indexes from a data table (ranges Row_Index_List and Col_Index_List). I
want
to look up the numbers in the corresponding row/column of range
Data_Table,
and return the sum of all returned values.

More detail: Row_Index_List and Col_Index_List are columns of (let's say)
100 cells, and Data_Table is a 7*5 range on the same sheet.

It looks like the combination of SUM(INDEX(..)) does not work in an array
formula. Can anyone suggest anything different. I have tried combinations
of
SUMIF, OFFSET, INDIRECT, SUMPRODUCT, but none seem to work. SUMIF gets
close,
but seems to return an array that is offset from the result I would
expect.

Thanks,
Dave



.



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 44
Default Using SUM + INDEX in array formula

Thanks for your time Jacob- this works just fine.

"Jacob Skaria" wrote:

Dave, the earlier one work on the row number...If you have row/col "indexes"
try the below version..

=SUMPRODUCT(SUM(OFFSET(INDIRECT(CELL("address",Dat a_Table)),(Row_Index_List)-1,(Col_Index_List)-1)))

--
Jacob (MVP - Excel)


"Jacob Skaria" wrote:

Hi Dave

Try the below

A1:A3 = row index
B1:B3 = col index

Col A Col B
1 4
2 5
3 6

The below should sum up cells D1,E2 and F3...

=SUMPRODUCT(SUM(OFFSET(A1,(A1:A3)-1,(B1:B3)-1)))

--
Jacob (MVP - Excel)


"Dave Ramage" wrote:

I'm having problems getting an array formula like this to work:
=SUM(INDEX(Data_Table,Row_Index_List,Col_Index_Lis t))

Basically, I have two columns of numbers that represent the row and column
indexes from a data table (ranges Row_Index_List and Col_Index_List). I want
to look up the numbers in the corresponding row/column of range Data_Table,
and return the sum of all returned values.

More detail: Row_Index_List and Col_Index_List are columns of (let's say)
100 cells, and Data_Table is a 7*5 range on the same sheet.

It looks like the combination of SUM(INDEX(..)) does not work in an array
formula. Can anyone suggest anything different. I have tried combinations of
SUMIF, OFFSET, INDIRECT, SUMPRODUCT, but none seem to work. SUMIF gets close,
but seems to return an array that is offset from the result I would expect.

Thanks,
Dave

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
Index Array Formula Assistance LJoe Excel Worksheet Functions 0 August 20th 07 07:34 PM
Array formula on INDEX function not working vsoler Excel Worksheet Functions 8 June 3rd 07 07:14 PM
Array formula with index + match Sena Excel Worksheet Functions 5 April 1st 07 06:06 AM
Index and Match Array formula Graham Haughs Excel Worksheet Functions 4 February 16th 06 01:51 AM
How to add in an array formula if iisna index match taxmom Excel Worksheet Functions 4 March 15th 05 01:51 PM


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