Grouping of Data based on Criteria

unknownymous

Board Regular
Joined
Sep 19, 2017
Messages
249
Office Version
  1. 2016
Platform
  1. Windows
Hi Guys,

Can you possibly help me on creating a macro that groups data based on below sample criteria:

Raw Data:

IDTeamNameStatusDateType
1MathAnaClosed
9/21/2017

<tbody>
</tbody>
Critical

<tbody>
</tbody>
2MathSeffOpen
9/29/2017

<tbody>
</tbody>
3MathLoganClosed
9/20/2017

<tbody>
</tbody>
4ScienceBenOpen
1/8/2018

<tbody>
</tbody>
Critical
5ScienceShyOpen
1/2/2018

<tbody>
</tbody>
6
Geography

<tbody>
</tbody>
EmsClosed
2/9/2018

<tbody>
</tbody>
7ScienceDanOpen
1/20/2018

<tbody>
</tbody>
MajorCritical

<tbody>
</tbody>
8ScienceJohnOpen
3/9/2018

<tbody>
</tbody>
Major
9ScienceJimOpen
2/27/2018

<tbody>
</tbody>
Critical
10ScienceLenaOpen
2/2/2018

<tbody>
</tbody>
Critical
11ScienceTomOpen
2/25/2018

<tbody>
</tbody>
12ScienceChaOpen
2/26/2018

<tbody>
</tbody>

<tbody>
</tbody>

Criteria:

1. On Raw tab, filter based on "TEAM" column and those that falls under "Science" , copy the header and each row to another tab and rename the sheet as "SCIENCE"
2. On SCIENCE tab, filter "STATUS" column and copy those lines tagged as "OPEN" to another tab sheet and rename as "CLEAN DATA"
3. On the CLEAN DATA tab - Filter the "DATE" column and get those that are within the 60 calendar days from the latest date (will be the final list); For those beyond the 60 calendar days, if they have a note type with Critical, MajorCritical & Major, add them on the final list (with orange highlight) and for those with blank note add a separator line and indicate as "EXCLUDED"

So basically, there will be 3 tabs - Raw, Science & Clean Data. The "Clean Data" tab will look like this:


IDTeamNameStatusDateType
8ScienceJohnOpen
3/9/2018

<tbody>
</tbody>
Major

<tbody>
</tbody>
9ScienceJimOpen
2/27/2018

<tbody>
</tbody>
Critical

<tbody>
</tbody>
12ScienceChaOpen
2/26/2018

<tbody>
</tbody>
11ScienceTomOpen
2/25/2018

<tbody>
</tbody>
10ScienceLenaOpen
2/2/2018

<tbody>
</tbody>
Critical

<tbody>
</tbody>
7ScienceDanOpen
1/20/2018

<tbody>
</tbody>
MajorCritical

<tbody>
</tbody>
4ScienceBenOpen
1/8/2018

<tbody>
</tbody>
Critical

<tbody>
</tbody>
EXCLUDED
5
Science

<tbody>
</tbody>
ShyOpen
1/2/2018

<tbody>
</tbody>

<tbody>
</tbody>


<tbody>
</tbody>


PS: The Columns might be interchangeable so might be useful if search will be use in looking for the header name instead of range (like search for "Team" instead of B:B)


Any help will be much appreciated. Thanks a lot :)
 
Last edited:

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).

Forum statistics

Threads
1,215,129
Messages
6,123,218
Members
449,091
Latest member
jeremy_bp001

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