Hi,
I'm trying to do a dynamic table that would change based on certain filters that I put. I would like to have a table that refers to a range in another worksheet in Excel and returns the top results given the parameters (filters) that I put in. So let's say, I would input filters that would request to pull bonds that have an maturity date between 2021 and 2025, have a BBB credit rating, have a spread above 100 above government bonds and the table would show the corresponding top results.
Here is an example of the filters:
Here is an example of the table that would be outputting the results and the formula I'm trying right now (but that isn't working):
Here is the range in another sheet that I would refer to:
I think the problem I'm having is related to the fact that the above range I'm referring to is a filtered range with TONS of blanks and errors in it. I would probably need to find a way to filter out the errors and the blanks and return the clean results in order for my formula to work. Here is the formula I was playing around with for now: =IFERROR(INDEX(Rankings!$A$1:$Z$10000,SMALL(IF((YEAR(Rankings!$J$1:$J$10000)>=$Q$2)*(YEAR(Rankings!$J$1:$J$10000)<=$Q$3)*(Rankings!$K$1:$K$10000=$Q$4)*(Rankings!$D$1:$D$10000=$Q$5)*(Rankings!$E$1:$E$10000=$Q$6),ROW(Rankings!$O$1:$O$10000)),ROW(1:1)),MATCH(B$1,Rankings!$A$1:$Z$1,0)),"")
Any help would be extremely appreciated to help me figure out why it isn't working and/or if I am right and it is linked to a filtered range with blanks & errors; how would you amend my formula to ignore those blanks and return the top results for my search?
Thank you in advance!
I'm trying to do a dynamic table that would change based on certain filters that I put. I would like to have a table that refers to a range in another worksheet in Excel and returns the top results given the parameters (filters) that I put in. So let's say, I would input filters that would request to pull bonds that have an maturity date between 2021 and 2025, have a BBB credit rating, have a spread above 100 above government bonds and the table would show the corresponding top results.
Here is an example of the filters:
Security selection dashboard - 2020-04-30.xlsx | ||||
---|---|---|---|---|
Q | R | |||
1 | Criteria | Parameters | ||
2 | Min Mat YR | 2021 | ||
3 | Max Mat YR | 2025 | ||
4 | Rating | BBB | ||
5 | Spread > | 100 | ||
6 | Sector 1 | CORP | ||
Dashboard |
Here is an example of the table that would be outputting the results and the formula I'm trying right now (but that isn't working):
Cell Formulas | ||
---|---|---|
Range | Formula | |
A2:N5 | A2 | =IFERROR(INDEX(Rankings!$A$1:$Z$10000,SMALL(IF((YEAR(Rankings!$J$1:$J$10000)>=$Q$2)*(YEAR(Rankings!$J$1:$J$10000)<=$Q$3)*(Rankings!$K$1:$K$10000=$Q$4)*(Rankings!$D$1:$D$10000=$Q$5)*(Rankings!$E$1:$E$10000=$Q$6),ROW(Rankings!$O$1:$O$10000)),ROW(1:1)),MATCH(A$1,Rankings!$A$1:$Z$1,0)),"") |
Press CTRL+SHIFT+ENTER to enter array formulas. |
Here is the range in another sheet that I would refer to:
Security selection dashboard - 2020-04-30.xlsx | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | |||
1 | ID_CUSIP | ID_BB_8_CHR | Ask Price | Ask Spread | SECTOR 1 | SECTOR 2 | Name | Ticker | Coupon Rate | Maturity Date | Rating | BB_5Y_DEFAULT_PROB | Base Currency | COUNTRY | Spread/5 YR default rate | ||
2 | 70137TAD7 | EK297293 Corp | 100.5 | -124.8 | CORP | Energy | PARKLAND FUEL CORP | PKICN | 5.5 | 5/28/2021 | BB | 2.79% | CAD | CANADA | -1 | ||
3 | 68323ADN1 | JK424252 Corp | 100.79 | -48.71 | PROV | ONT | ONTARIO (PROVINCE OF) | ONT | 0 | 3/16/2021 | AA- | 1.19% | CAD | CANADA | 0 | ||
4 | 563469TK1 | EI148095 Corp | 0 | -40.8 | PROV | Other | MANITOBA (PROVINCE OF) | MP | 4.15 | 6/3/2020 | A+ | 1.19% | CAD | CANADA | 0 | ||
5 | 13509PEW9 | EK929060 Corp | 100.14 | -36.9 | FEDERAL | CANHOU | CANADA HOUSING TRUST | CANHOU | 0 | 9/15/2020 | AAA | 1.19% | CAD | CANADA | 0 | ||
6 | 13509PFE8 | QJ828643 Corp | 100.43 | -30.72 | FEDERAL | CANHOU | CANADA HOUSING TRUST | CANHOU | 0 | 3/15/2021 | AAA | 1.19% | CAD | CANADA | 0 | ||
7 | 68323AEB6 | QZ993662 Corp | 100.79 | -28.54 | PROV | ONT | ONTARIO (PROVINCE OF) | ONT | 0 | 10/27/2021 | AA- | 1.19% | CAD | CANADA | 0 | ||
Rankings |
Cell Formulas | ||
---|---|---|
Range | Formula | |
A2:A7,E2:N7 | A2 | =IFERROR(INDEX('C:\Users\Gab\Dropbox\Nymbus Bonds\Databases\[Db - Canadian Bond Universe.xlsm]Aggregate'!$A$2:$AP$99998,MATCH(LEFT($B2,LEN($B2)-5),'C:\Users\Gab\Dropbox\Nymbus Bonds\Databases\[Db - Canadian Bond Universe.xlsm]Aggregate'!$B$2:$B$14998,0),MATCH(A$1,'C:\Users\Gab\Dropbox\Nymbus Bonds\Databases\[Db - Canadian Bond Universe.xlsm]Aggregate'!$2:$2,0)),"") |
B2 | B2 | =IF('RUNZ Export'!A1219<>0,'RUNZ Export'!A1219,"") |
C2:D7 | C2 | =IFERROR(INDEX('RUNZ Export'!$A:$X,MATCH(INDIRECT("B"&ROW()),'RUNZ Export'!$A:$A,0),MATCH(Rankings!C$1,'RUNZ Export'!$1:$1,0)),"") |
O2:O7 | O2 | =IFERROR(IFERROR(((D2^3)/100000000)/L2,((D2^3)/1000000)/INDEX(Table1[#All],MATCH(INDIRECT("K"&ROW()),Table1[[#All],[CORP Equivalent Rating]],0),MATCH("Default Risk %",Table1[#Headers],0))),"") |
B3 | B3 | =IF('RUNZ Export'!A383<>0,'RUNZ Export'!A383,"") |
B4 | B4 | =IF('RUNZ Export'!A382<>0,'RUNZ Export'!A382,"") |
B5 | B5 | =IF('RUNZ Export'!A381<>0,'RUNZ Export'!A381,"") |
B6 | B6 | =IF('RUNZ Export'!A380<>0,'RUNZ Export'!A380,"") |
B7 | B7 | =IF('RUNZ Export'!A379<>0,'RUNZ Export'!A379,"") |
I think the problem I'm having is related to the fact that the above range I'm referring to is a filtered range with TONS of blanks and errors in it. I would probably need to find a way to filter out the errors and the blanks and return the clean results in order for my formula to work. Here is the formula I was playing around with for now: =IFERROR(INDEX(Rankings!$A$1:$Z$10000,SMALL(IF((YEAR(Rankings!$J$1:$J$10000)>=$Q$2)*(YEAR(Rankings!$J$1:$J$10000)<=$Q$3)*(Rankings!$K$1:$K$10000=$Q$4)*(Rankings!$D$1:$D$10000=$Q$5)*(Rankings!$E$1:$E$10000=$Q$6),ROW(Rankings!$O$1:$O$10000)),ROW(1:1)),MATCH(B$1,Rankings!$A$1:$Z$1,0)),"")
Any help would be extremely appreciated to help me figure out why it isn't working and/or if I am right and it is linked to a filtered range with blanks & errors; how would you amend my formula to ignore those blanks and return the top results for my search?
Thank you in advance!