Return List of Values with Exceptions for Special Grouping

nau2002

Board Regular
Joined
Dec 19, 2016
Messages
97
Hello,

I have a spreadsheet I need to modify in a way I'm not sure is possible. I currently have formulas in place to return all 'Projects' (beginning in row A6) that match a selected 'Group' (as indicated in cell B2) and include the actual spending against each 'Project' for the selected time period (as indicated in cell B3). In the example below, since 'Cats' is selected for '2016 Q2', all projects matching that group are returned along with the 'Actual' cost for that period.

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A
[/TD]
[TD]B
[/TD]
[TD]C
[/TD]
[TD]D
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]Group
[/TD]
[TD]Cats
[/TD]
[TD][/TD]
[TD]Data Validation
[/TD]
[/TR]
[TR]
[TD]3
[/TD]
[TD]Quarter
[/TD]
[TD]2016 Q2
[/TD]
[TD][/TD]
[TD]Cats
[/TD]
[/TR]
[TR]
[TD]4
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Dogs
[/TD]
[/TR]
[TR]
[TD]5
[/TD]
[TD]Project
[/TD]
[TD]Actual
[/TD]
[TD][/TD]
[TD]Birds
[/TD]
[/TR]
[TR]
[TD]6
[/TD]
[TD]Project 1
[/TD]
[TD]35,455
[/TD]
[TD][/TD]
[TD]Fish
[/TD]
[/TR]
[TR]
[TD]7
[/TD]
[TD]Project 2
[/TD]
[TD]64,545
[/TD]
[TD][/TD]
[TD]2016 Q1
[/TD]
[/TR]
[TR]
[TD]8
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]2016 Q2
[/TD]
[/TR]
[TR]
[TD]9
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]2016 Q3
[/TD]
[/TR]
[TR]
[TD]10
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]2016 Q4
[/TD]
[/TR]
[TR]
[TD]11
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]2017 Q1
[/TD]
[/TR]
[TR]
[TD]12
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]2017 Q2
[/TD]
[/TR]
[TR]
[TD]13
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

Here is an example of the formula in cell A6:
=IFERROR(INDEX('Source Data'!$D$4:$D$19,SMALL(IF(ISNUMBER(MATCH('Source Data'!$B$4:$B$19,$B$2,0)),ROW('Source Data'!$B$4:$B$19)-ROW('Source Data'!$4:$4)+1),ROWS($A$6:$A6))),"")

The challenge is, I have a new requirement where within the group 'Fish' (and only within the group 'Fish'), there are some projects (but not all 'Fish' projects) that should be combined with other projects from other groups (e.g. Cat). For these such projects, the dollars should just be added to the other project. Here are the values that should be combined:

[TABLE="width: 292"]
<tbody>[TR]
[TD]'Fish' Projects to be combined:
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Actual Group
[/TD]
[TD="colspan: 2"]Combination Group
[/TD]
[/TR]
[TR]
[TD]PROJECT 1A
[/TD]
[TD]Project 1
[/TD]
[TD] (Cats)
[/TD]
[/TR]
[TR]
[TD]Project 4A
[/TD]
[TD]Project 4
[/TD]
[TD] (Dogs)
[/TD]
[/TR]
</tbody>[/TABLE]

So, Project 1A should have it's $'s added to Project 1 (which appears under 'Cats'). In the example above, if Project 1A had actuals costs of $20k for the selected period, the result for Project 1 should be $55,455.

Project 1A should not be listed anywhere in the results (whether the user selects 'Cats' or 'Fish' which is the original group. Can my formulas in Column A be modified to accommodate for such a requirement? Note that the list of projects requiring combination is fairly short and static. I can easily maintain them in a table on the spreadsheet or, given it's just a few of them, put them directly in the formula by name if there's a way to do that.

Thanks in advance! Sorry to be so long-winded on this request!
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.

Forum statistics

Threads
1,223,228
Messages
6,170,875
Members
452,363
Latest member
merico17

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