Formula_Find_Target

josros60

Well-known Member
Joined
Jun 27, 2010
Messages
786
Office Version
  1. 365
Hi,

I have the formula below works fine from this range(Range1) "A2:A10" but if I insert more rows formula won't work have not idea why won't work, any suggestion please.

formula:

VBA Code:
=IF(ISNUMBER(MATCH(ROWS($1:1),IF(INDEX(MOD(INT((List2-1)/2^(TRANSPOSE(List1)-1)),2),MATCH(TRUE,MMULT(MOD(INT((List2-1)/2^(TRANSPOSE(List1)-1)),2),Range1)=$E$2,0),),TRANSPOSE(List1)),0)),"X","")


Thank you,
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
How many more rows are you inserting? You may be exceeding the limit of what MMULT can handle.
 
Upvote 0
Can you provide more details, please? I'm trying to understand what you want to do. What do the named ranges Range1, List1, and List2 refer to?
 
Upvote 0
I would to inser 13 rows more instead of 17 rows be 30.
noticed also when enter target # and press enter really slow blue circle spinning.

Here the formulas: (also putting sample spredsheet:

List1 =
VBA Code:
=ROW(INDIRECT("1:"&ROWS(Range1)))
List2 =
VBA Code:
=ROW(INDIRECT("1:"&2^ROWS(Range1)))
Range1 =
VBA Code:
=FIND_TARGET!$A$2:$A$17

Sheet:

MATCHING_TARGET_VALUE$.xlsm
ABCD
1AMOUNTSINVOICE #RESULTS$
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18TOTAL OF SUM TARGET>>$ -
FIND_TARGET
Cell Formulas
RangeFormula
D2:D17D2=IF(C2="X",A2,"")
C2:C17C2=IF(ISNUMBER(MATCH(ROWS($1:1),IF(INDEX(MOD(INT((List2-1)/2^(TRANSPOSE(List1)-1)),2),MATCH(TRUE,MMULT(MOD(INT((List2-1)/2^(TRANSPOSE(List1)-1)),2),Range1)=$E$2,0),),TRANSPOSE(List1)),0)),"X","")
C18C18=SUM(D2:D17)
Named Ranges
NameRefers ToCells
Range1=FIND_TARGET!$A$2:$A$17C2:C17, D2



thank you
 
Upvote 0
You did not include column E, but based on your reference to a "target" and the $E$2 in the formula, I am guessing that it looks something like the example below. It would be helpful to describe what you are trying to do. I still have not completely figured out your formula, or why it is constructed the way it is. You have arrays that are 2^16 long and INDIRECT functions, both of which will slow down the sheet performance. It appears that you want to match an input "target" amount in $E$2 to the amounts shown in column A. And if a match is found, place an "X" in the corresponding row of column C (Results). And where there is an "X" in the Results column, copy the amount from column A into column D for summing. If this is true, then would not a much simpler formula work....like this?
Book2
ABCDE
1AMOUNTSINVOICE #RESULTS$Target
2101  107
3102
4103
5104
6105
7106
8107X107
9108
10109
11107X107
12111
13112
14113
15114
16115
17116
18TOTAL OF SUM TARGET>>214
FIND_TARGET
Cell Formulas
RangeFormula
C2:C17C2=IF($A$2:$A$17=$E$2,"X","")
D2:D17D2=IF($C$2:$C$17="X",$A$2:$A$17,"")
C18C18=SUM(D2#)
Dynamic array formulas.
 
Upvote 0
Solution
I'm happy to help. Note that this approach returns X's for all amounts that match the target input. I'm not sure if that is what you want...depends on your application/purpose..
 
Upvote 0

Forum statistics

Threads
1,224,875
Messages
6,181,513
Members
453,050
Latest member
Obil

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top