Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 1
Default Combine various cells in to one array

I have the following formula that I would like to shorten it. Is it possible?

=12.5%*(($A$1=$C1)+(($A$1=$C6)*2)+(($A$1=$C11)*3)+ (($A$1=$C16)*4)+(($A$1=$C21)*5))

To following is just an idea but doesn't work on excel.

=12.5%*(($C1,$C6,$C11,$C16,$C21)=$A$1)*{1,2,3,4,5}

I wanted to use SUMPRODUCT but it only take contiguous array. Thanks for any input.

PS: I can not use array C1:C21 because other cells within it may equal to $A$1 which will return incorrect result. And the 3rd part, {1,2...} would be too long.

Last edited by Odin : May 20th 10 at 08:55 PM Reason: Additional info.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 83
Default Combine various cells in to one array

On Thu, 20 May 2010 20:38:45 +0100, Odin
wrote:


I have the following formula that I would like to shorten it. Is it
possible?

=12.5%*(($A$1=$C1)+(($A$1=$C6)*2)+(($A$1=$C11)*3) +(($A$1=$C16)*4)+(($A$1=$C21)*5))

To following is just an idea but doesn't work on excel.

=12.5%*(($C1,$C6,$C11,$C16,$C21)=$A$1)*{1,2,3,4,5 }

I wanted to use SUMPRODUCT but it only take contiguous array. Thanks
for any input.

PS: I can not use array C1:C21 because other cells within it may equal
to $A$1 which will return incorrect result. And the 3rd part, {1,2...}
would be too long.


Try this formula, it is 19 characters shorter than the one you have:

=12.5%*SUMPRODUCT((MOD(ROW(5:25),5)=0)*ROW(5:25)/5*(C1:C21=A1))

Hope this helps / Lars-Åke

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
& combine two array statements Paul Moles Excel Worksheet Functions 3 December 9th 09 11:24 AM
combine cells exceler Excel Discussion (Misc queries) 0 February 4th 09 09:10 PM
combine cells Luke M Excel Discussion (Misc queries) 0 February 4th 09 09:06 PM
Combine cells with the same reference and combine quantities brandon Excel Discussion (Misc queries) 2 September 17th 08 05:44 PM
combining cells and array from different sheets into an array to pass to IRR() [email protected] Excel Discussion (Misc queries) 3 September 11th 06 07:17 AM


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