Index/Match and VBA Question

mcmahobt

Board Regular
Joined
Sep 2, 2014
Messages
55
Hello all,

First post here, hopefully it's in the right spot. I have been scouring the forum looking for a solution to this problem, but to no avail so far.

Basically, I have a workbook that visually reports the Fiscal Year status of our product in the field. The Fiscal Years run from FY 11 to FY 30. The product version is set to automatically change based on the value in a separate spreadsheet, and conditionally change color based on said value. This works fine, and is accomplished by a simple IF statement/formula shown below:

=IF('Fielding Plan '!$D11="Upgrade","CXG 1","")

The problem, however, comes next. Taking a portion of the workbook as an example, the status of our product may look like this:

FY 11
FY 12FY 13FY 14FY 15FY 16
CXG 1
CXG 2
CXG 3
CXG 4

<tbody>
</tbody>

This is done to multiple versions of our product, not just CXG. So what I am trying to accomplish, is to pull all the results to the top of the column, in order to save space when printing. I am trying to get the result to look something like this:

FY 11
FY 12FY 13FY 14FY 15FY 16
CXG 1CXG 2CXG 4
CXG 3

<tbody>
</tbody>

The problem I have run into with using INDEX/MATCH is that they don't carry over conditional formatting, which I need conserved. I'm assuming VBA code is needed for this, but I do not have enough knowledge in that area to be able to apply it. Any help is greatly appreciated!
 
Try this formula in A2:

=IF(ISNUMBER(SMALL(IF('Fielding Plan '!D$11:D$19="Upgrade",ROW(A$2:A$10)-ROW(A$2)+1),ROWS(A$2:A2))),"CXG "&ROWS(A$2:A2),"")

confirmed with Ctrl+Shift+Enter and copied down to A3:A10.

Andrew,

Tried the formula, but to no avail. It's very similar to the method I was trying before; I think you're onto something with making it an IF statement at the beginning. A quick question though concerning the equation: shouldn't ISNUMBER be ISTEXT if there is a text string in the cell, as is with "CXG"?

Again, thanks for your time and effort. Hopefully this will put me on the right track after some more fiddling.
 
Upvote 0

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Try this formula in A2:

=IF(ISNUMBER(SMALL(IF('Fielding Plan '!D$11:D$19="Upgrade",ROW(A$2:A$10)-ROW(A$2)+1),ROWS(A$2:A2))),"CXG "&ROWS(A$2:A2),"")

confirmed with Ctrl+Shift+Enter and copied down to A3:A10.

Andrew,

Tried typing in the equation this morning just to humor myself, and it seems to work fine now. I'm not sure what the error was before, but it was obviously on my end. Thanks again for the help!
 
Upvote 0
Andrew,

Tried typing in the equation this morning just to humor myself, and it seems to work fine now. I'm not sure what the error was before, but it was obviously on my end. Thanks again for the help!

Andrew,

Hopefully one more quick question to finalize this problem of mine...as it appears to me, the problem I was running into earlier is still occurring.

While the equation is "rolling" up the data well, it is not referencing the correct CXG product numbers. For example, this is what is currently happening when I implement the formula:


Raw Data:


Upgrade
CXG 1
CXG 3
CXG 4

<tbody>
</tbody>

Formula Conversion:
Upgrade
CXG 1
CXG 2
CXG 3

<tbody>
</tbody>

As you can see, it seems as if the formula is just starting at "1" by default, and counting up by increments of 1 regardless of what the text is showing. I'm not sure if this is a cell reference error on my part, but I've tried playing with the formula earlier today to no avail. Will keep working on it though in the meantime.

Any help is appreciated!
 
Upvote 0
Andrew,

The Upgrade D11:D19 are on a separate sheet that contains the raw data. The CXG 1 thru 3 are on the master sheet that is used for the visual representations. Hope this helps! I'll keep working on it as well to see if I can find a solution.
 
Upvote 0
That doesn't really answer my question, but if the suffix should be the position of Upgrade in D11:D19 try:

=IFERROR("CXG "&SMALL(IF('Fielding Plan '!D$11:D$19="Upgrade",ROW(A$2:A$10)-ROW(A$2)+1),ROWS(A$2:A2)),"")
 
Upvote 0
Andrew,

That did the trick. Whatever you changed seemed to work perfectly. Thank you for all your help!
 
Upvote 0

Forum statistics

Threads
1,214,606
Messages
6,120,485
Members
448,967
Latest member
visheshkotha

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