+ Reply to Thread
Results 1 to 14 of 14

Match Type and Count with IDs and organize my Type and Count

  1. #1
    Forum Contributor
    Join Date
    08-15-2006
    Location
    USA
    MS-Off Ver
    Office 365, 64 bit
    Posts
    362

    Match Type and Count with IDs and organize my Type and Count

    Column ID will vary as far as the number of IDs it will have. The color red helps match the ID with the Type & Count in column C.

    The Data Source has the ID column and the Type the ID will have and a count

    Need a macro that will match the Type & Count by ID.

    The Data Source has more than 15k rows with the ID (range:1 - 60000) rows and Type & Count columns; matching this manually takes days as the counts change on bi-weekly basis.

    Please refer to sample file...
    Attached Files Attached Files

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,887

    Re: Match Type and Count with IDs and organize my Type and Count

    With Power Query, unpivot your data and remove all rows in which there are zeros.

    Please Login or Register  to view this content.
    Power Query is a free AddIn for Excel 2010 and 2013, and is built-in functionality from Excel 2016 onwards (where it is referred to as "Get & Transform Data").

    It is a powerful yet simple way of getting, changing and using data from a broad variety of sources, creating steps which may be easily repeated and refreshed. I strongly recommend learning how to use Power Query - it's among the most powerful functionalities of Excel.

    - Follow this link to learn how to install Power Query in Excel 2010 / 2013.

    - Follow this link for an introduction to Power Query functionality.

    - Follow this link for a video which demonstrates how to use Power Query code provided.
    Attached Files Attached Files
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Contributor
    Join Date
    08-15-2006
    Location
    USA
    MS-Off Ver
    Office 365, 64 bit
    Posts
    362

    Re: Match Type and Count with IDs and organize my Type and Count

    Thanks for the reply on this request.

    So now that the Power Query has separated the ID, Attribute (Type) and Value (Count) into 3 columns, how do I accomplish the grouping of applicable Type/Count based on the IDs in the ID column as per the Data tab sample?

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,887

    Re: Match Type and Count with IDs and organize my Type and Count

    Please explain the criteria for the grouping. Why would 18 and 31 be grouped in the same cell? This is not obvious to me. Why is 58 alone? Need more information if this is critical to your solution.

  5. #5
    Forum Contributor
    Join Date
    08-15-2006
    Location
    USA
    MS-Off Ver
    Office 365, 64 bit
    Posts
    362

    Re: Match Type and Count with IDs and organize my Type and Count

    The ID column will be a manual input by me. It could be 1 ID or 5 IDs or more. What is very time consuming and labor intensive is the grouping in the Type & Count column. Based on the IDs in the Data tab, I need for the VBA to go to the Data Source tab and identify the type/count per each ID in the Data tab ID column and group them the Type & Count column. It's color coded (black, red, black, red...) so that we can match tge groupings with the IDs.

  6. #6
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: Match Type and Count with IDs and organize my Type and Count

    Here is a VBA solution since the thread has not been designated as solved. Let us know if the groupings align to your expectations.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  7. #7
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: Match Type and Count with IDs and organize my Type and Count

    This iteration alternates the font color if that is what you want to do.

    Please Login or Register  to view this content.
    Last edited by maniacb; 02-27-2021 at 10:44 PM. Reason: small correction to row count calculation

  8. #8
    Forum Contributor
    Join Date
    08-15-2006
    Location
    USA
    MS-Off Ver
    Office 365, 64 bit
    Posts
    362

    Re: Match Type and Count with IDs and organize my Type and Count

    This is a great start (the alternate color). This will reduce my workload by 50%. What would reduce it by 90% is where the ID row that has more than 1 ID, the grouping would be in the same row, in the Type & Count column as per the sample file. If that's not possible, I'll just filter, copy and paste the groupings into that cell... thx so much ...

  9. #9
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: Match Type and Count with IDs and organize my Type and Count

    How do we know which ID’s to combine?

  10. #10
    Forum Contributor
    Join Date
    08-15-2006
    Location
    USA
    MS-Off Ver
    Office 365, 64 bit
    Posts
    362

    Re: Match Type and Count with IDs and organize my Type and Count

    Hi maniacb...

    If you notice in my attached file column B (ID), those IDs I have already manually input the ID or IDs (in most cases it may only have 1 ID, in some cases it may have 10). However, once I've manually input the ID(s) into that column, it mostly remains static.

    My challenge is to get the Type & Count per ID in the ID column and group them in the Type & Count column in the corresponding row.

    Take for example B4 - that only had 1 ID so the results in the Type & Count is 2 different type and their count.

    However, B5 has 2 IDs. Now I need to get the Type & Count per ID and paste it in C5, in the top to down order. So you can see in C5 that the black font corresponds to the 1st ID and the red font corresponds to the 2nd ID. Since the Type & Count is very dynamic (changes weekly) that's where I need the help on.

  11. #11
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103
    If you share your static ID column, we may be able to use it as a reference to create your desired result. Please share that column of ID’s.

  12. #12
    Forum Contributor
    Join Date
    08-15-2006
    Location
    USA
    MS-Off Ver
    Office 365, 64 bit
    Posts
    362

    Re: Match Type and Count with IDs and organize my Type and Count

    In the attached file (02-25-2021, 05:20 PM), the Data tab, column B (ID), that's the column of static IDs. My master currently has 350 rows, each with a static ID or IDs per cell. That's the column the macro will reference to create my desired result in column C (Type & Count) from the Data Source tab... I only provided a sample of the static IDs in the attached file...

  13. #13
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Match Type and Count with IDs and organize my Type and Count

    Please try

    Please Login or Register  to view this content.
    Note that round ,0) is used for round ID column B in Data Source.

    8.333333333 8
    10.83333333 11
    13.33333333 13

    Remove the red part if ID is interger or Text
    Attached Files Attached Files

  14. #14
    Forum Contributor
    Join Date
    08-15-2006
    Location
    USA
    MS-Off Ver
    Office 365, 64 bit
    Posts
    362

    Re: Match Type and Count with IDs and organize my Type and Count

    Thanks, this works perfectly. It's amazing how my workload has gone down to 3 mins max from almost a day... thanks to everyone who pitched in to resolve this for me. Excel Forums is amazing...

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Index-Match type lookup to assign phrase to a number from a MaxDiff type survey matrix
    By FivestarMac in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-15-2018, 02:24 PM
  2. How to count type of the point?
    By onohong in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 08-12-2015, 01:04 AM
  3. Count by type
    By eareeyesee in forum Excel General
    Replies: 2
    Last Post: 01-15-2015, 06:56 PM
  4. [SOLVED] multiple conditions to count large amount of data by Type, month & activity type
    By norfolk_lass in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-03-2014, 12:54 PM
  5. Count job type for each month
    By Back2Basics in forum Excel General
    Replies: 4
    Last Post: 05-26-2009, 06:09 AM
  6. Looking for a count type function
    By pmaura in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-13-2007, 09:52 AM
  7. [SOLVED] A Count-type formula?
    By brbolin in forum Excel General
    Replies: 3
    Last Post: 04-01-2005, 11:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1