Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Dear all,
How to count the number of integers when sum of those, calculated from left to right, meets a predefined target E.g: Range: 50, 100, 200, 100, 150, 300 Target: 450 Function should return 4 Thanks! |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hi!
Use a helper row: Assume your values are in the range A1:F1 In A2 enter this formula: =SUM($A1:A1) Copy across to F2 A5 = target value = 450 =INDEX(COLUMN(A2:F2),MATCH(A5,A2:F2,0)) Biff wrote in message oups.com... Dear all, How to count the number of integers when sum of those, calculated from left to right, meets a predefined target E.g: Range: 50, 100, 200, 100, 150, 300 Target: 450 Function should return 4 Thanks! |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Biff wrote...
Assume your values are in the range A1:F1 In A2 enter this formula: =SUM($A1:A1) Copy across to F2 A5 = target value = 450 =INDEX(COLUMN(A2:F2),MATCH(A5,A2:F2,0)) .... No ancillary cells needed. Also, why the INDEX call? Would the MATCH call return 4? Indeed, move (*cut* & paste) A1:F1 into AA1:AF1. Then what does your formula return? Anyway, one single cell alternative would be the array formula =MATCH(A5,MMULT(A1:F1,--(COLUMN(A1:F1)=TRANSPOSE(COLUMN(A1:F1)))),0) |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Dear Harlan, thanks for really elegant solution. Please let me ask one
and maybe silly question: what "--" means in this part of function --(COLUMN(A1:F1)... ? Why odd numebr of "-" returnes 6 and even return 4, as far as studued example in concerned? |
#5
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
why the INDEX call?
That is kind of superfluous, isn't it? Biff "Harlan Grove" wrote in message oups.com... Biff wrote... Assume your values are in the range A1:F1 In A2 enter this formula: =SUM($A1:A1) Copy across to F2 A5 = target value = 450 =INDEX(COLUMN(A2:F2),MATCH(A5,A2:F2,0)) ... No ancillary cells needed. Also, why the INDEX call? Would the MATCH call return 4? Indeed, move (*cut* & paste) A1:F1 into AA1:AF1. Then what does your formula return? Anyway, one single cell alternative would be the array formula =MATCH(A5,MMULT(A1:F1,--(COLUMN(A1:F1)=TRANSPOSE(COLUMN(A1:F1)))),0) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
"COUNTU" function in Excel to count unique entries in a range | Excel Worksheet Functions | |||
how do I count the number of times text in column A matches text i | Excel Worksheet Functions | |||
Table to pick out most common entries and count occurences of each | Excel Worksheet Functions | |||
count duplicate (or, inversely, unique) entries, but based on a condition | Excel Worksheet Functions | |||
count data but avoid double entries | Excel Worksheet Functions |