Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 229
Default offset and Sum function

I maintain my school data in excel. Column A is the ID nos of the students.
Column M contians respective Fee amounts. In columns y, z, aa, ab, ac We
maintian the sibling's IDs. We calculate the total amount of all the
siblings to pay in a column. The following is the formula we are using
IF(LEN($Y3)1,SUM(OFFSET($M$1,MATCH($Y3,$A$2:$A$94 8,0),0,1,1))+SUM(OFFSET($M$1,MATCH($Z3,$A$2:$A$948 ,0),0,1,1))+SUM(OFFSET($M$1,MATCH($AA3,$A$2:$A$948 ,0),0,1,1))+SUM(OFFSET($M$1,MATCH($AB3,$A$2:$A$948 ,0),0,1,1))+SUM(OFFSET($M$1,MATCH($AC3,$A$2:$A$948 ,0),0,1,1)),0)
It works well. Can anyone please suggest me a simple procedure for it
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 30
Default offset and Sum function

On Fri, 13 Jul 2007 03:08:02 -0700, yshridhar
wrote:

I maintain my school data in excel. Column A is the ID nos of the students.
Column M contians respective Fee amounts. In columns y, z, aa, ab, ac We
maintian the sibling's IDs. We calculate the total amount of all the
siblings to pay in a column. The following is the formula we are using
IF(LEN($Y3)1,SUM(OFFSET($M$1,MATCH($Y3,$A$2:$A$9 48,0),0,1,1))+SUM(OFFSET($M$1,MATCH($Z3,$A$2:$A$94 8,0),0,1,1))+SUM(OFFSET($M$1,MATCH($AA3,$A$2:$A$94 8,0),0,1,1))+SUM(OFFSET($M$1,MATCH($AB3,$A$2:$A$94 8,0),0,1,1))+SUM(OFFSET($M$1,MATCH($AC3,$A$2:$A$94 8,0),0,1,1)),0)
It works well. Can anyone please suggest me a simple procedure for it


Sorry, I don't have any simple procedure to suggest.
However, you can shorten your formula a bit by removing the ",1,1"
at the end of each of the five OFFSET's.
And you can write SUM(OFFSET(...), OFFSET(...), ...) instead of
SUM(OFFSET(...))+SUM(OFFSET(...))+...

These two changes reduces the formula from 265 to 225 characters.

Perhaps someone else can come up with a real simple procedure.

/ Lars-Åke


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,886
Default offset and Sum function

Hi

I would be inclined to enter the following formula in AD3
=IF(Y3="",0,INDEX($M:$M,MATCH(Y3,$A$2:$A$948,0)))
and copy across through AE3:AH3

The amount to be billed would then be
=M3+SUM(AD3:AH3)
as I presume the amount for the first child in the family will be held
in cell M3.

If you did want your formula all in one cell, then the following is
slightly shorter than your original, and has the advantage of not being
volatile.
=IF(LEN($Y3)1,
INDEX($M:$M,MATCH($Y3,$A$2:$A$948,0))
+INDEX($M:$M,MATCH($Z3,$A$2:$A$948,0))
+INDEX($M:$M,MATCH($AA3,$A$2:$A$948,0))
+INDEX($M:$M,MATCH($AB3,$A$2:$A$948,0))
+INDEX($M:$M,MATCH($AC3,$A$2:$A$948,0)),0)
This would also require the addition of the value from M3 to pick up the
first sibling

--
Regards

Roger Govier


"yshridhar" wrote in message
...
I maintain my school data in excel. Column A is the ID nos of the
students.
Column M contians respective Fee amounts. In columns y, z, aa, ab, ac
We
maintian the sibling's IDs. We calculate the total amount of all the
siblings to pay in a column. The following is the formula we are
using
IF(LEN($Y3)1,SUM(OFFSET($M$1,MATCH($Y3,$A$2:$A$94 8,0),0,1,1))+SUM(OFFSET($M$1,MATCH($Z3,$A$2:$A$948 ,0),0,1,1))+SUM(OFFSET($M$1,MATCH($AA3,$A$2:$A$948 ,0),0,1,1))+SUM(OFFSET($M$1,MATCH($AB3,$A$2:$A$948 ,0),0,1,1))+SUM(OFFSET($M$1,MATCH($AC3,$A$2:$A$948 ,0),0,1,1)),0)
It works well. Can anyone please suggest me a simple procedure for it



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 21
Default offset and Sum function

This is optimized for shortness:

=M3 + SUMPRODUCT(Fee, MMULT(--(ID=Y3:AC3),{1;1;1;1;1;1}))

Using your actual ranges:

=M3 + SUMPRODUCT(M$3:M$948, MMULT(--(A$3:A$948=Y3:AC3),{1;1;1;1;1;1}))

Notice there must be as many 1's in the last array as columns in the
Sibling fields, and the 1's are separated by semicolons. The "--"
converts calculated True/False values to 1's and 0's. The other
suggested formulas might refresh faster.

- David Hilberg

On Jul 13, 6:08 am, yshridhar
wrote:
I maintain my school data in excel. Column A is the ID nos of the students.
Column M contians respective Fee amounts. In columns y, z, aa, ab, ac We
maintian the sibling's IDs. We calculate the total amount of all the
siblings to pay in a column. The following is the formula we are using
IF(LEN($Y3)1,SUM(OFFSET($M$1,MATCH($Y3,$A$2:$A$94 8,0),0,1,1))+SUM(OFFSET($M$1,MATCH($Z3,$A$2:$A$948 ,0),0,1,1))+SUM(OFFSET($M$1,MATCH($AA3,$A$2:$A$948 ,0),0,1,1))+SUM(OFFSET($M$1,MATCH($AB3,$A$2:$A$948 ,0),0,1,1))+SUM(OFFSET($M$1,MATCH($AC3,$A$2:$A$948 ,0),0,1,1)),0)
It works well. Can anyone please suggest me a simple procedure for it





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 21
Default offset and Sum function

This is optimized for shortness:

=M3 + SUMPRODUCT(Fee, MMULT(--(ID=Y3:AC3),{1;1;1;1;1}))

Using your actual ranges:

=M3 + SUMPRODUCT(M$3:M$948, MMULT(--(A$3:A$948=Y3:AC3),{1;1;1;1;1}))

Notice there must be as many 1's in the last array as columns in the
Sibling fields, and the 1's are separated by semicolons. The "--"
converts calculated True/False values to 1's and 0's. The other
suggested formulas might refresh faster.

- David Hilberg

[replacing earlier post with erroneous number of 1's]


On Jul 13, 6:08 am, yshridhar
wrote:
I maintain my school data in excel. Column A is the ID nos of the students.
Column M contians respective Fee amounts. In columns y, z, aa, ab, ac We
maintian the sibling's IDs. We calculate the total amount of all the
siblings to pay in a column. The following is the formula we are using
IF(LEN($Y3)1,SUM(OFFSET($M$1,MATCH($Y3,$A$2:$A$94 8,0),0,1,1))+SUM(OFFSET($M$1,MATCH($Z3,$A$2:$A$948 ,0),0,1,1))+SUM(OFFSET($M$1,MATCH($AA3,$A$2:$A$948 ,0),0,1,1))+SUM(OFFSET($M$1,MATCH($AB3,$A$2:$A$948 ,0),0,1,1))+SUM(OFFSET($M$1,MATCH($AC3,$A$2:$A$948 ,0),0,1,1)),0)
It works well. Can anyone please suggest me a simple procedure for it



  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 229
Default offset and Sum function

Thank You Mr. Roger. Can you tell me which one is faster in execution either
the formula you sent or the offset which i am using. Why offset is volatile.
Can you please explain
With regards
Sridhar


"Roger Govier" wrote:

Hi

I would be inclined to enter the following formula in AD3
=IF(Y3="",0,INDEX($M:$M,MATCH(Y3,$A$2:$A$948,0)))
and copy across through AE3:AH3

The amount to be billed would then be
=M3+SUM(AD3:AH3)
as I presume the amount for the first child in the family will be held
in cell M3.

If you did want your formula all in one cell, then the following is
slightly shorter than your original, and has the advantage of not being
volatile.
=IF(LEN($Y3)1,
INDEX($M:$M,MATCH($Y3,$A$2:$A$948,0))
+INDEX($M:$M,MATCH($Z3,$A$2:$A$948,0))
+INDEX($M:$M,MATCH($AA3,$A$2:$A$948,0))
+INDEX($M:$M,MATCH($AB3,$A$2:$A$948,0))
+INDEX($M:$M,MATCH($AC3,$A$2:$A$948,0)),0)
This would also require the addition of the value from M3 to pick up the
first sibling

--
Regards

Roger Govier


"yshridhar" wrote in message
...
I maintain my school data in excel. Column A is the ID nos of the
students.
Column M contians respective Fee amounts. In columns y, z, aa, ab, ac
We
maintian the sibling's IDs. We calculate the total amount of all the
siblings to pay in a column. The following is the formula we are
using
IF(LEN($Y3)1,SUM(OFFSET($M$1,MATCH($Y3,$A$2:$A$94 8,0),0,1,1))+SUM(OFFSET($M$1,MATCH($Z3,$A$2:$A$948 ,0),0,1,1))+SUM(OFFSET($M$1,MATCH($AA3,$A$2:$A$948 ,0),0,1,1))+SUM(OFFSET($M$1,MATCH($AB3,$A$2:$A$948 ,0),0,1,1))+SUM(OFFSET($M$1,MATCH($AC3,$A$2:$A$948 ,0),0,1,1)),0)
It works well. Can anyone please suggest me a simple procedure for it




  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 806
Default offset and Sum function

Hello,

With Sandy's formula I could not get correct results.

FastExcel showed in my test environment for:
Roger 27.04 msec
Sridhar 27.39 msec
David 2113.87 msec

Volatile means recalculation with each F9 even if input does not
change (should be avoided).

Regards,
Bernd

  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 229
Default offset and Sum function

Thank you Mr. Bernd. Is there any special procedure to determine the
execution time of a function. Can you please explain me
With regards
Sridhar


"Bernd P" wrote:

Hello,

With Sandy's formula I could not get correct results.

FastExcel showed in my test environment for:
Roger 27.04 msec
Sridhar 27.39 msec
David 2113.87 msec

Volatile means recalculation with each F9 even if input does not
change (should be avoided).

Regards,
Bernd


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
Offset Function jagbabbra Excel Worksheet Functions 2 May 24th 06 03:17 PM
Offset function with nested match function not finding host ss. MKunert Excel Worksheet Functions 1 March 21st 06 10:46 PM
help with offset function Barb Excel Worksheet Functions 3 May 24th 05 05:51 PM
help with offset function Mexage Excel Worksheet Functions 0 May 24th 05 05:18 PM
offset function LA Excel Worksheet Functions 10 April 19th 05 09:11 AM


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