Multiple Matches but only pulling 1st one

CrashOD

Board Regular
Joined
Feb 5, 2019
Messages
118
Office Version
  1. 2021
  2. 2016
Platform
  1. Windows
tried doing this codes looking for
C12 ' is the value i'm wanting to search for were they can be multi matches if there is i need B44-B46, D44-D46 have values in there
'SK Real Estate'!$U:$U ' is the location to look for the info to match to (C12)

B44 ' should show SK Real Estate'!$H:$H
'SK Real Estate'!$H:$H ' (Date) is the value i want returned if there is a value

B45 ' should show 'SK Real Estate'!$J:$J
'SK Real Estate'!$J:$J ' (Date) is the value i want returned if there is a value

B46 ' should show 'SK Real Estate'!$L:$L
'SK Real Estate'!$L:$L ' (Date) is the value i want returned if there is a value

D44 ' should show SK Real Estate'!$I:$I
'SK Real Estate'!$I:$I ' (Amount) is the value i want returned if there is a value

D45 ' should show 'SK Real Estate'!$K:$K
'SK Real Estate'!$K:$K ' (Amount) is the value i want returned if there is a value

D46 ' should show 'SK Real Estate'!$M:$M
'SK Real Estate'!$M:$M ' (Amount) is the value i want returned if there is a value

I tried the below codes with no luck. B44 & D44 get filled in but nothing more. on the picture below with the black boxes line 1170 in $U matches for the 2nd time witch should fill in B45 & d45 for 2nd payment.

=IF(ISNUMBER(MATCH('SK Real Estate'!$A:$U, $C$12)), MATCH($C$12('SK Real Estate'!$A:$U), ROW('SK Real Estate'!$A:$U)), "")

=INDEX('SK Real Estate'!$A:$U,MATCH(C12,'SK Real Estate'!$U:$U,0),8)

=IFERROR(INDEX('SK Real Estate'!$H:$H, SMALL(IF($C$12='SK Real Estate'!$U:$U, ROW('SK Real Estate'!$U:$U)-ROW('SK Real Estate'!$U)+1), ROW(1:1))),"" )


this picture shows were im pulling data from (this exact sheet in in the same workbook im looking to put code in. why i used 'SK Real Estate'! and not reference a workbook then sheet
excel.png



the picture below is were im doing the code for B44:B46 & D44:d46. yes the total due is wrong for face changing code to pull the other amount on sheet should be
321.41​
327.97​
360.77​

1654277725194.png


Thanks so much for any help!
 
After addressing my Post 60 question, please go back to your E12 cell, click in the formula bar, hit F2 to enter edit mode, and then re-enter the formula (re-confirm it) by hitting Ctrl-Shift-Enter to enter it as an array formula...you don't need to type anything else. You should see curly brackets automatically appear around the formula in the formula bar. Then let me know if that produces the correct result.
 
Upvote 0

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
original code
=MAX( AGGREGATE(15,6,ridx/(INDEX(data,,21)=$C$12),ROW(INDIRECT(1&":"&COUNTIF(INDEX(data,,21),$C$12)))) *
(MMULT(--(INDEX(data,AGGREGATE(15,6,ridx/(INDEX(data,,21)=$C$12),ROW(INDIRECT(1&":"&COUNTIF(INDEX(data,,21),$C$12)))),{8,9,10,11,12,13})<>0),{1;1;1;1;1;1}) =
MAX(MMULT(--(INDEX(data,AGGREGATE(15,6,ridx/(INDEX(data,,21)=$C$12),ROW(INDIRECT(1&":"&COUNTIF(INDEX(data,,21),$C$12)))),{8,9,10,11,12,13})<>0),{1;1;1;1;1;1}) ) ) )

converted code
=MAX( {1209;1876;2706} *
(MMULT(--(INDEX(data,{1209;1876;2706},{8,9,10,11,12,13})<>0),{1;1;1;1;1;1}) =
MAX(MMULT(--(INDEX(data,{1209;1876;2706},{8,9,10,11,12,13})<>0),{1;1;1;1;1;1}) ) ) )

Automated 2022 Tax Certification Form.xlsm
ABCDEFGHIJKLMNOPTU
2707RUNKEL JUDITH R 0160013710/29/2021F44528/3/21$80.688/30/21$80.6610/29/21$80.6680.66266.206700016-01-008-014
SK 2021


seems to be 1 row off but guessing from were it is restricted to looking. so seems to match up.
 
Upvote 0
Oh good...so the formula is working fine. Those results aren't really one row off. Remember, the formula is returning the row index, not the row number. So row numbers 2,3,4,5 in your spreadsheet have row indexes of 1,2,3,4. So a row index of 2706 should be found on row number 2707...and it is. Please go back to the E12 formula (I believe that is where the row index formula is found?) and click in the formula bar, hit F2 to enter Edit mode, and then hit Ctrl-Shift-Enter to re-enter that formula as an array formula. Then see if it returns only the value of 2706 (that appears to be where you'll find the most transactions for this latest example).
 
Upvote 0
1655406551924.png


i was looking things up was one of the things i tried since you can not type it your self the {8,9,10,11,12,13} they should be the curly ones around it?
, ->{8,9,10,11,12,13}<- )<>0), ->{1;1;1;1;1;1}<- )
what does the {1;1;1;1;1;1} do?
 
Upvote 0
To enter an array formula in the formula bar, you cannot type the curly brackets { }....those need to be inserted by Excel by entering the formula with Ctrl-Shift-Enter. But within a formula, if you want to create an array, you can type the curly brackets, which is what we have in:
Excel Formula:
MMULT(--(INDEX(data,AGGREGATE(15,6,ridx/(INDEX(data,,21)=$C$12),ROW(INDIRECT(1&":"&COUNTIF(INDEX(data,,21),$C$12)))),{8,9,10,11,12,13})<>0),{1;1;1;1;1;1})
This multiplies two arrays by each other...but to answer your question better, a more detailed explanation is needed.

Let's start with the AGGREGATE function tucked inside the main formula in three places:
Excel Formula:
AGGREGATE(15,6,ridx/(INDEX(data,,21)=$C$12),ROW(INDIRECT(1&":"&COUNTIF(INDEX(data,,21),$C$12))))
The AGGREGATE function operates on an array, and while it can perform many different operations on that array, in this case, we want to use it to return a list of row indexes where the parcel shown in $C$12 is found in column U of your main data table. And in this case, for convenience, we want the row indexes returned in order, from smallest to largest, much like you would do if manually searching down column U from the top to the bottom. Used like this, AGGREGATE takes 4 arguments:
The 1st argument is code 15, which tells AGGREGATE to return the smallest values first, and you have an option to return the 1st smallest, 2nd smallest, 3rd smallest, etc. That is handled by the last argument of the AGGREGATE function (more on that in a moment).
The 2nd argument (6) tells AGGREGATE to ignore any errors that are generated. This is a good thing because we will intentionally create some errors to find the matches (explained next).
The 3rd argument in the AGGREGATE function divides one array by another...ridx/(INDEX(data,,21)=$C$12)
Let's break this down further. Recall that the named variable "ridx" (row indexes) is formed by the formula:
Excel Formula:
ROW($X$2:$X$7000)-ROW($X$2)+1
which will result in an array that looks like {1;2;3;...6998;6999}. This is a single vertical array that has row index numbers corresponding to rows 2:7000 in your data table.
Then recall we have a named variable called "data" that refers to cells A$2:$AI$7000 in the main data table. The INDEX function used here:
Excel Formula:
(INDEX(data,,21)=$C$12)
returns column index 21 from "data", and since "data" begins at column A, column index 21 is the same as the 21st column, or column U. So this part of the function looks down column U and determines whether any of the parcels shown match the one specified in $C$12. The result will be a vertical array consisting of 6999 rows, and each row contains a value of either TRUE or FALSE, with TRUE indicating that a match is found at that position. The 3rd argument divides the first array by the second, which would look something like this:
{1;2;3;...6998;6999} / {FALSE;TRUE;FALSE;...TRUE,FALSE}
and when Excel performs arithmetic operations on arrays, the TRUE's are converted to 1's and the FALSE's to 0's, so this produces a resultant array that looks like this:
{#DIV/0!;2;#DIV/0!;...6998;#DIV/0!}
where the division by 0 errors indicate that there is no match at that location, and any other values indicate that a match was found at that row index location. This is the advantage of using AGGREGATE with the 6 option to ignore errors, and this allows us to filter to retain only the row indexes that we want.
The 4th argument of the AGGREGATE function indicates which of the values to return from the resultant array. Since the 15 code means return smallest first, a 1 as the 4th argument returns the absolute smallest value, a 2 the next smallest, etc. We want all of the row indexes reported back to us, so we need to know how many were found. So we count them with:
Excel Formula:
COUNTIF(INDEX(data,,21),$C$12)
which looks at column U of the main table and counts the number of times a match is found with the value in $C$12. We then feed that number into this function...
Excel Formula:
ROW(INDIRECT(1&":"&COUNTIF(INDEX(data,,21),$C$12)))
...to create a sequential dynamic array beginning with the number 1 and ending with the number determined from the COUNTIF function. Let's suppose COUNTIF finds that there are 2 rows containing transaction details for a parcel on $C$12. So the 2 is fed into the ROW(INDIRECT function and an array is returned that looks like {1;2}...a two row array consisting of sequential numbers beginning with 1.
The end result then is that the AGGREGATE function returns an array of row index numbers, ordered from smallest to largest, where matches were found, and the array in the 4th argument says to return the 1st smallest value, then the 2nd smallest value, etc. until all values have been returned. That's what the {1209;1876;2706} indicates in your last post...so the COUNTIF function found that there are three matches, and those matches are found at the row indexes shown (which would correspond to row numbers 1210, 1877, and 2707.
This is the type of result generated by the AGGREGATE function in the 1st line of the main formula...an array of row index numbers where matches exist.

But there is much more to do...we still need to determine which of those row indexes has the most transactions. So we repeat the AGGREGATE function and then operate on the resulting array a little further...I'm considering this part which appears in the 2nd and 3rd lines of the main formula:
Excel Formula:
INDEX(data,AGGREGATE(15,6,ridx/(INDEX(data,,21)=$C$12),ROW(INDIRECT(1&":"&COUNTIF(INDEX(data,,21),$C$12)))),{8,9,10,11,12,13})
To simplify the appearance, and since we already know what AGGREGATE returns, let's substitute in a realistic array for it, like the one in your last post:
INDEX(data, {1209;1876;2706}, {8,9,10,11,12,13})
This tells the INDEX formula to access the main data table $A$2:$AI:$7000 and return the intersection of row indexes {1209;1876;2706} with column indexes {8,9,10,11,12,13}. This is like copying the range H:M (columns indexes 8-13) for rows 1210, 1877, and 2707 and creating a small mini-table of those values, 3 rows long and 6 columns wide. Let's call this the mini-matrix of dates and amounts, or "mmda" for short. We know that some rows of mmda may not be filled out completely, and we want to determine which one has the most transactions. So we evaluate each element in the mmda matrix to determine if the value is NOT equal to 0 (or NOT a blank):
Excel Formula:
(INDEX(data,AGGREGATE(15,6,ridx/(INDEX(data,,21)=$C$12),ROW(INDIRECT(1&":"&COUNTIF(INDEX(data,,21),$C$12)))),{8,9,10,11,12,13})<>0)
which is is equivalent to
mmda <> 0
The 3 x 6 matrix of values (of dates, payment amounts, and blanks) will now have the same structure, but will consist of TRUE's and FALSE's, with TRUE's indicating that transaction data exist. We need to convert these TRUE's and FALSE's to 1's and 0's for the next step, so we apply the double unary operator to convert the TRUE/FALSE matrix into a matrix of 1's and 0's. That is equivalent to --(mmda <> 0).

Almost done! This big expression...
Excel Formula:
(MMULT(--(INDEX(data,AGGREGATE(15,6,ridx/(INDEX(data,,21)=$C$12),ROW(INDIRECT(1&":"&COUNTIF(INDEX(data,,21),$C$12)))),{8,9,10,11,12,13})<>0),{1;1;1;1;1;1})
can now be thought of like this:
Excel Formula:
(MMULT(--(mmda <> 0), {1;1;1;1;1;1})
...for the example in your last post, a small 3 x 6 matrix of 1's and 0's will be multiplied by a column array consisting of 6 1's (this is what you asked about). But why? We want to count across each of the rows in the 3 x 6 matrix to determine how many 1's there are...or since they are just 1's, we can add across each row. That tells us, of the 6 columns H:M in the data table, how many of those 6 columns contain transaction data. But your version of Excel does not offer a direct way to perform this across-the-row addition, so matrix multiplication provides a solution. Each element across the row is multiplied by the corresponding vertical array element in the {1;1;1;1;1;1} array and then those 6 multiplication products are added together. That single number tells us the number of 1's on the row. This is repeated for each row to produce the sum on each, so the end result is a 3 row by 1 column array with the number of transaction-related entries corresponding to each row in the mmda matrix. Here is a visual showing what the matrix resulting from (--mmda <> 0) might look like multiplied by the vertical array of 6 1's that you asked about, and this would evaluate to {2;4;6}, as shown:
MrExcel_20220610.xlsx
GHIJKLMNOPQR
102
103
10411000012
105111100*1=4
10611111116
1071
1081
1091
110
Tax Cert Form (3)
Cell Formulas
RangeFormula
Q104:Q106Q104=MMULT(H104:M106,O104:O109)
Dynamic array formulas.

This is the type of result generated by the 2nd line of the main formula...an array showing the count of the number of entries in the date/payment section...in each row of the mmda matrix.

We know we want the row index holding the most transactions, so you will see the same formula just described wrapped by a MAX function so that it returns a single value...in this case a 6. That's all the 3rd line of the main formula does...it returns the number of the most non-blank/non-zero cells on a row in the mmda matrix.

Now in your latest post, let's suppose row indexes {1209;1876;2706} contain 2, 4, and 6 non-blank cells, respectively...so we can tell that we would like to identify row index 2706 as the one from which to pull all of the values. Putting it all together, for the example in your last post and with this assumption, the main formula would look like:
=MAX( {1209;1876;2706} * ( {2;4;6} = MAX({2;4;6}) ) )
which becomes
=MAX( {1209;1876;2706} * ( {2;4;6} = 6 ) )
and then evaluating the 2nd term involving the logical = we would get:
=MAX( {1209;1876;2706} * {FALSE; FALSE; TRUE} )
because only the last element in the {2;4;6} array evaluates as TRUE (that is the MAX value).
Finally, we multiply these two arrays together, recalling that TRUE's are coerced to 1's and FALSE's to 0's, so we get:
=MAX( {0; 0; 2706} )
and the MAX of that array is row index 2706. That's how the main formula works, and it appears to me that you are getting expected results for terms in this formula, so I suspect something else is wrong.

I don't know of a good way to troubleshoot the issue you seem to be having without seeing the file. If you would like, you could create a copy of your workbook. Delete all worksheets except for the test Tax Cert Form that you have been working with. Delete any sensitive information on that sheet, but leave the formulas that have been discussed intact. Then on the data sheets, delete any sensitive data...I really only need columns H:M and U for debugging, but you can leave more if desired. Then upload that file to a file sharing site like Dropbox, Drive, Box, etc. and provide a sharing link.
 
Upvote 0
To enter an array formula in the formula bar, you cannot type the curly brackets { }....those need to be inserted by Excel by entering the formula with Ctrl-Shift-Enter. But within a formula, if you want to create an array, you can type the curly brackets, which is what we have in:
Excel Formula:
MMULT(--(INDEX(data,AGGREGATE(15,6,ridx/(INDEX(data,,21)=$C$12),ROW(INDIRECT(1&":"&COUNTIF(INDEX(data,,21),$C$12)))),{8,9,10,11,12,13})<>0),{1;1;1;1;1;1})
This multiplies two arrays by each other...but to answer your question better, a more detailed explanation is needed.

Let's start with the AGGREGATE function tucked inside the main formula in three places:
Excel Formula:
AGGREGATE(15,6,ridx/(INDEX(data,,21)=$C$12),ROW(INDIRECT(1&":"&COUNTIF(INDEX(data,,21),$C$12))))
The AGGREGATE function operates on an array, and while it can perform many different operations on that array, in this case, we want to use it to return a list of row indexes where the parcel shown in $C$12 is found in column U of your main data table. And in this case, for convenience, we want the row indexes returned in order, from smallest to largest, much like you would do if manually searching down column U from the top to the bottom. Used like this, AGGREGATE takes 4 arguments:
The 1st argument is code 15, which tells AGGREGATE to return the smallest values first, and you have an option to return the 1st smallest, 2nd smallest, 3rd smallest, etc. That is handled by the last argument of the AGGREGATE function (more on that in a moment).
The 2nd argument (6) tells AGGREGATE to ignore any errors that are generated. This is a good thing because we will intentionally create some errors to find the matches (explained next).
The 3rd argument in the AGGREGATE function divides one array by another...ridx/(INDEX(data,,21)=$C$12)
Let's break this down further. Recall that the named variable "ridx" (row indexes) is formed by the formula:
Excel Formula:
ROW($X$2:$X$7000)-ROW($X$2)+1
which will result in an array that looks like {1;2;3;...6998;6999}. This is a single vertical array that has row index numbers corresponding to rows 2:7000 in your data table.
Then recall we have a named variable called "data" that refers to cells A$2:$AI$7000 in the main data table. The INDEX function used here:
Excel Formula:
(INDEX(data,,21)=$C$12)
returns column index 21 from "data", and since "data" begins at column A, column index 21 is the same as the 21st column, or column U. So this part of the function looks down column U and determines whether any of the parcels shown match the one specified in $C$12. The result will be a vertical array consisting of 6999 rows, and each row contains a value of either TRUE or FALSE, with TRUE indicating that a match is found at that position. The 3rd argument divides the first array by the second, which would look something like this:
{1;2;3;...6998;6999} / {FALSE;TRUE;FALSE;...TRUE,FALSE}
and when Excel performs arithmetic operations on arrays, the TRUE's are converted to 1's and the FALSE's to 0's, so this produces a resultant array that looks like this:
{#DIV/0!;2;#DIV/0!;...6998;#DIV/0!}
where the division by 0 errors indicate that there is no match at that location, and any other values indicate that a match was found at that row index location. This is the advantage of using AGGREGATE with the 6 option to ignore errors, and this allows us to filter to retain only the row indexes that we want.
The 4th argument of the AGGREGATE function indicates which of the values to return from the resultant array. Since the 15 code means return smallest first, a 1 as the 4th argument returns the absolute smallest value, a 2 the next smallest, etc. We want all of the row indexes reported back to us, so we need to know how many were found. So we count them with:
Excel Formula:
COUNTIF(INDEX(data,,21),$C$12)
which looks at column U of the main table and counts the number of times a match is found with the value in $C$12. We then feed that number into this function...
Excel Formula:
ROW(INDIRECT(1&":"&COUNTIF(INDEX(data,,21),$C$12)))
...to create a sequential dynamic array beginning with the number 1 and ending with the number determined from the COUNTIF function. Let's suppose COUNTIF finds that there are 2 rows containing transaction details for a parcel on $C$12. So the 2 is fed into the ROW(INDIRECT function and an array is returned that looks like {1;2}...a two row array consisting of sequential numbers beginning with 1.
The end result then is that the AGGREGATE function returns an array of row index numbers, ordered from smallest to largest, where matches were found, and the array in the 4th argument says to return the 1st smallest value, then the 2nd smallest value, etc. until all values have been returned. That's what the {1209;1876;2706} indicates in your last post...so the COUNTIF function found that there are three matches, and those matches are found at the row indexes shown (which would correspond to row numbers 1210, 1877, and 2707.
This is the type of result generated by the AGGREGATE function in the 1st line of the main formula...an array of row index numbers where matches exist.

But there is much more to do...we still need to determine which of those row indexes has the most transactions. So we repeat the AGGREGATE function and then operate on the resulting array a little further...I'm considering this part which appears in the 2nd and 3rd lines of the main formula:
Excel Formula:
INDEX(data,AGGREGATE(15,6,ridx/(INDEX(data,,21)=$C$12),ROW(INDIRECT(1&":"&COUNTIF(INDEX(data,,21),$C$12)))),{8,9,10,11,12,13})
To simplify the appearance, and since we already know what AGGREGATE returns, let's substitute in a realistic array for it, like the one in your last post:
INDEX(data, {1209;1876;2706}, {8,9,10,11,12,13})
This tells the INDEX formula to access the main data table $A$2:$AI:$7000 and return the intersection of row indexes {1209;1876;2706} with column indexes {8,9,10,11,12,13}. This is like copying the range H:M (columns indexes 8-13) for rows 1210, 1877, and 2707 and creating a small mini-table of those values, 3 rows long and 6 columns wide. Let's call this the mini-matrix of dates and amounts, or "mmda" for short. We know that some rows of mmda may not be filled out completely, and we want to determine which one has the most transactions. So we evaluate each element in the mmda matrix to determine if the value is NOT equal to 0 (or NOT a blank):
Excel Formula:
(INDEX(data,AGGREGATE(15,6,ridx/(INDEX(data,,21)=$C$12),ROW(INDIRECT(1&":"&COUNTIF(INDEX(data,,21),$C$12)))),{8,9,10,11,12,13})<>0)
which is is equivalent to
mmda <> 0
The 3 x 6 matrix of values (of dates, payment amounts, and blanks) will now have the same structure, but will consist of TRUE's and FALSE's, with TRUE's indicating that transaction data exist. We need to convert these TRUE's and FALSE's to 1's and 0's for the next step, so we apply the double unary operator to convert the TRUE/FALSE matrix into a matrix of 1's and 0's. That is equivalent to --(mmda <> 0).

Almost done! This big expression...
Excel Formula:
(MMULT(--(INDEX(data,AGGREGATE(15,6,ridx/(INDEX(data,,21)=$C$12),ROW(INDIRECT(1&":"&COUNTIF(INDEX(data,,21),$C$12)))),{8,9,10,11,12,13})<>0),{1;1;1;1;1;1})
can now be thought of like this:
Excel Formula:
(MMULT(--(mmda <> 0), {1;1;1;1;1;1})
...for the example in your last post, a small 3 x 6 matrix of 1's and 0's will be multiplied by a column array consisting of 6 1's (this is what you asked about). But why? We want to count across each of the rows in the 3 x 6 matrix to determine how many 1's there are...or since they are just 1's, we can add across each row. That tells us, of the 6 columns H:M in the data table, how many of those 6 columns contain transaction data. But your version of Excel does not offer a direct way to perform this across-the-row addition, so matrix multiplication provides a solution. Each element across the row is multiplied by the corresponding vertical array element in the {1;1;1;1;1;1} array and then those 6 multiplication products are added together. That single number tells us the number of 1's on the row. This is repeated for each row to produce the sum on each, so the end result is a 3 row by 1 column array with the number of transaction-related entries corresponding to each row in the mmda matrix. Here is a visual showing what the matrix resulting from (--mmda <> 0) might look like multiplied by the vertical array of 6 1's that you asked about, and this would evaluate to {2;4;6}, as shown:
MrExcel_20220610.xlsx
GHIJKLMNOPQR
102
103
10411000012
105111100*1=4
10611111116
1071
1081
1091
110
Tax Cert Form (3)
Cell Formulas
RangeFormula
Q104:Q106Q104=MMULT(H104:M106,O104:O109)
Dynamic array formulas.

This is the type of result generated by the 2nd line of the main formula...an array showing the count of the number of entries in the date/payment section...in each row of the mmda matrix.

We know we want the row index holding the most transactions, so you will see the same formula just described wrapped by a MAX function so that it returns a single value...in this case a 6. That's all the 3rd line of the main formula does...it returns the number of the most non-blank/non-zero cells on a row in the mmda matrix.

Now in your latest post, let's suppose row indexes {1209;1876;2706} contain 2, 4, and 6 non-blank cells, respectively...so we can tell that we would like to identify row index 2706 as the one from which to pull all of the values. Putting it all together, for the example in your last post and with this assumption, the main formula would look like:
=MAX( {1209;1876;2706} * ( {2;4;6} = MAX({2;4;6}) ) )
which becomes
=MAX( {1209;1876;2706} * ( {2;4;6} = 6 ) )
and then evaluating the 2nd term involving the logical = we would get:
=MAX( {1209;1876;2706} * {FALSE; FALSE; TRUE} )
because only the last element in the {2;4;6} array evaluates as TRUE (that is the MAX value).
Finally, we multiply these two arrays together, recalling that TRUE's are coerced to 1's and FALSE's to 0's, so we get:
=MAX( {0; 0; 2706} )
and the MAX of that array is row index 2706. That's how the main formula works, and it appears to me that you are getting expected results for terms in this formula, so I suspect something else is wrong.

I don't know of a good way to troubleshoot the issue you seem to be having without seeing the file. If you would like, you could create a copy of your workbook. Delete all worksheets except for the test Tax Cert Form that you have been working with. Delete any sensitive information on that sheet, but leave the formulas that have been discussed intact. Then on the data sheets, delete any sensitive data...I really only need columns H:M and U for debugging, but you can leave more if desired. Then upload that file to a file sharing site like Dropbox, Drive, Box, etc. and provide a sharing link.
i have no problem with that but is it allowed? i don't want to get anyone in trouble or kicked from here. but i do agree may help if you can look at them. i wanted to segest that but dont want to violate rules to get us in trouble.
 
Upvote 0
Yes, that's not a problem. Generally, the preferred method is to use the XL2BB add-in for sharing small working examples of spreadsheets...and it's a wonderful tool for doing most things on this forum. Occasionally, where some problems are difficult to sort out, code needs to be debugged, multiple sheets cross-reference each other, etc....those tend to be more difficult to resolve. In those cases, file sharing is often used.
 
Upvote 0
Thank you. As far as I can tell, everything checks out fine. I saw the #VALUE error in E12, so I investigated a few things. The parcel to look up was 016-01-008-014. I manually searched for it in sheet SK 2021 and found it on rows 1210, 1877, and 2707. Then I split the E12 formula apart to confirm that each piece produced the expected results (as explained in my post #65). You can see those various pieces of the formula producing results in cells H11:M11. And the row indexes found by the formula (1209;1876;2706} are correct...they correspond to the row numbers. So at that point, I simply deleted the equals sign that begins the formula in cell E12, which causes Excel to treat the formula as a text string (and the row height will expand if word wrap is active for that cell)...and then I retyped = at the beginning of the formula and hit Enter... and it worked! I don't know why, but that seemed to work. Did you insert a bunch of @ symbols in the formulas?...I don't know any reason why they would be needed here. I've cleaned up the formulas to eliminate them.
Automated 2022 Tax Certification Form.xlsm
ABCDEFGHIJKLM
1
2Data Sheet Names
3SK 2021
4SK 2020
5SK 2019
6parcels for testingChoose Data Set
7016-01-008-014SK 2021
8013-02-005-3171
9011-01-003-135
10
11Parcel Look UpRow Index of Record120926FALSE02706
12016-01-008-014270618764FALSE0
1327066TRUE2706
14
42SCHOOL 2021July/AugSept/OctNov/Dec
43Discount (-2%)Face:Penalty (+10%)
44PAID237.16242266.2
45Date Paid:10/29/2021HomeSteadAssessed Value
46NO6700
47PARTIALSDATE0<- SHORT IN FACE
48PAYMENT #18/3/2180.68FACE
49PAYMENT #28/30/202180.66FACE
50PAYMENT #310/29/202180.66FACE
Sheet1
Cell Formulas
RangeFormula
I8I8=ROW($A$2:$A$7000)-ROW($A$2)+1
H11:H13H11=AGGREGATE(15,6,ridx/(INDEX(data,,21)=$C$12),ROW(INDIRECT(1&":"&COUNTIF(INDEX(data,,21),$C$12))))
I11:I13I11=MMULT(--(INDEX(data,AGGREGATE(15,6,ridx/(INDEX(data,,21)=$C$12),ROW(INDIRECT(1&":"&COUNTIF(INDEX(data,,21),$C$12)))),{8,9,10,11,12,13})<>0),{1;1;1;1;1;1})
J11J11=MAX(MMULT(--(INDEX(data,AGGREGATE(15,6,ridx/(INDEX(data,,21)=$C$12),ROW(INDIRECT(1&":"&COUNTIF(INDEX(data,,21),$C$12)))),{8,9,10,11,12,13})<>0),{1;1;1;1;1;1}) )
K11:K13K11=(MMULT(--(INDEX(data,AGGREGATE(15,6,ridx/(INDEX(data,,21)=$C$12),ROW(INDIRECT(1&":"&COUNTIF(INDEX(data,,21),$C$12)))),{8,9,10,11,12,13})<>0),{1;1;1;1;1;1}) = MAX(MMULT(--(INDEX(data,AGGREGATE(15,6,ridx/(INDEX(data,,21)=$C$12),ROW(INDIRECT(1&":"&COUNTIF(INDEX(data,,21),$C$12)))),{8,9,10,11,12,13})<>0),{1;1;1;1;1;1}) ) )
L11:L13L11= AGGREGATE(15,6,ridx/(INDEX(data,,21)=$C$12),ROW(INDIRECT(1&":"&COUNTIF(INDEX(data,,21),$C$12)))) * (MMULT(--(INDEX(data,AGGREGATE(15,6,ridx/(INDEX(data,,21)=$C$12),ROW(INDIRECT(1&":"&COUNTIF(INDEX(data,,21),$C$12)))),{8,9,10,11,12,13})<>0),{1;1;1;1;1;1}) = MAX(MMULT(--(INDEX(data,AGGREGATE(15,6,ridx/(INDEX(data,,21)=$C$12),ROW(INDIRECT(1&":"&COUNTIF(INDEX(data,,21),$C$12)))),{8,9,10,11,12,13})<>0),{1;1;1;1;1;1}) ) )
M11,E12M11=MAX( AGGREGATE(15,6,ridx/(INDEX(data,,21)=$C$12),ROW(INDIRECT(1&":"&COUNTIF(INDEX(data,,21),$C$12)))) * (MMULT(--(INDEX(data,AGGREGATE(15,6,ridx/(INDEX(data,,21)=$C$12),ROW(INDIRECT(1&":"&COUNTIF(INDEX(data,,21),$C$12)))),{8,9,10,11,12,13})<>0),{1;1;1;1;1;1}) = MAX(MMULT(--(INDEX(data,AGGREGATE(15,6,ridx/(INDEX(data,,21)=$C$12),ROW(INDIRECT(1&":"&COUNTIF(INDEX(data,,21),$C$12)))),{8,9,10,11,12,13})<>0),{1;1;1;1;1;1}) ) ) )
C44C44=INDEX(data,$E$12,31)
D44D44=INDEX(data,$E$12,32)
E44E44=INDEX(data,$E$12,33)
B44B44=IF(B45="","UNPAID",IF(B45="EXONERATED","PER COUNTY",IF(B45="Tax Claims", "SHORT", "PAID")))
B45B45=IF(D47<=0,C50,IF(D47<D44,"Tax Claims",INDEX(data,$E$12,3)))
E46E46=INDEX(data,$E$12,20)
D46D46=INDEX(data,$E$12,35)
D47D47=IF(D48="","",IF(OR(SUM(D48:D50)>=D44,SUM(D44,-D48:D50)<0.02),0,SUM(D44,-D48:D50)))
C48:C50C48=IFERROR(IF(ROWS($C$48:C48)<=COUNTA(INDEX(data,$E$12,{8,9,10,11,12,13}))/2,INDEX(data,$E$12,7+2*ROWS($C$48:C48)-1),""),"")
D48:D50D48=IFERROR(IF(ROWS($D$48:D48)<=COUNTA(INDEX(data,$E$12,{8,9,10,11,12,13}))/2,INDEX(data,$E$12,7+2*ROWS($D$48:D48)),""),"")
E48E48=IF(C48="","", "FACE")
E49:E50E49=IF(C49="","",IF($D$48<D49,"PENALTY","FACE"))
Dynamic array formulas.
Cells with Data Validation
CellAllowCriteria
E7List=$G$3:$G$5
 
Upvote 0
i keep formula as was sent other then changing tab names to simplify things and make drop down readable. i don't know why you would use a @ in formula.
Automated 2022 Tax Certification Form.xlsm
ABCDEFG
1
2Data Sheet Names
3SK 2021
4SK 2020
5SK 2019
6parcels for testingChoose Data Set
7016-01-008-014SK 2021
8013-02-005-317
9011-01-003-135
10
11Parcel Look UpRow Index of Record
12016-01-008-014#VALUE!
13
Sheet1
Cell Formulas
RangeFormula
E12E12=MAX(AGGREGATE(15,6,ridx/(INDEX(data,,21)=$C$12),ROW(INDIRECT(1&":"&COUNTIF(INDEX(data,,21),$C$12))))* MAX(AGGREGATE(15,6,ridx/(INDEX(data,,21)=$C$12),ROW(INDIRECT(1&":"&COUNTIF(INDEX(data,,21),$C$12))))*(MMULT(--(INDEX(data,AGGREGATE(15,6,ridx/(INDEX(data,,21)=$C$12),ROW(INDIRECT(1&":"&COUNTIF(INDEX(data,,21),$C$12)))),{8,9,10,11,12,13})<>0),{1;1;1;1;1;1})=MAX(MMULT(--(INDEX(data,AGGREGATE(15,6,ridx/(INDEX(data,,21)=$C$12),ROW(INDIRECT(1&":"&COUNTIF(INDEX(data,,21),$C$12)))),{8,9,10,11,12,13})<>0),{1;1;1;1;1;1})))))
Press CTRL+SHIFT+ENTER to enter array formulas.
Cells with Data Validation
CellAllowCriteria
E7List=$G$3:$G$5


i changed it to what you had in you post of it. i took the = sign out and put in still get same value. I tried using replace = for = since that fixes some of the issues for somereason. i even did the f2 then ctrl shift enter so {} showed up and sill get error in my excel 2016
 
Upvote 0

Forum statistics

Threads
1,214,535
Messages
6,120,093
Members
448,944
Latest member
SarahSomethingExcel100

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