+ Reply to Thread
Results 1 to 6 of 6

Matching header data and returning all non-blank values?

  1. #1
    Registered User
    Join Date
    01-20-2016
    Location
    USA!
    MS-Off Ver
    Office 2010
    Posts
    62

    Matching header data and returning all non-blank values?

    Hi all, I have vehicle names in A1:AE1, under each header are actual model years (i.e., 1999, 2001, etc). Some headers only have one year under them, some have eleven. I need a formula (in a separate worksheet) that will match the car name and list each year next to it.

    I have the worksheet attached, I'm hoping there is a good array formula that will do this. I think once you open the file, you will understand what I am looking for.

    Thank you for your help!!!
    Attached Files Attached Files

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Matching header data and returning all non-blank values?

    Hi alexx,

    Power Query to the rescue. If you install the Power Query Add-In this is simple work. No vba. No formulas.

    Steps...
    1. Click anywhere in your first table. Power Query from Table.
    2. Select all the columns of data in the PQ Editor
    3. Unpivot Only Selected Columns (they are all selected)
    4. I sorted by year and car and renamed the column heads but you don't need to.
    5. Close and Load (I did this into Sheet1).

    See the attached. Easy Peasy?

    Car Data (1).xlsx

    This is a close link:
    https://trumpexcel.com/unpivot-data/
    except in your problem select all the columns and unpivot them.
    Last edited by MarvinP; 05-08-2018 at 04:40 PM.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    01-20-2016
    Location
    USA!
    MS-Off Ver
    Office 2010
    Posts
    62

    Re: Matching header data and returning all non-blank values?

    HI Marvin, I should have asked no PowerQuery either the reason being, is this is going to be part of a larger spreadsheet. I will use the new columnar data to do some data variance analysis. Once I am finished, I am envisioning a completely automated solution for my end user.

    The way the data is currently laid out on my real report, it is completely dynamic.

    Could you have compassion on me this time and toss me a formula if you know of one??

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Matching header data and returning all non-blank values?

    So no Power Query

    How about some VBA? Will all the data start in A1? Will "completely dynamic" mean the car list is in row 1 and the years are down under each?

    If you want a formula only and no VBA then I'm not that smart.

  5. #5
    Registered User
    Join Date
    01-20-2016
    Location
    USA!
    MS-Off Ver
    Office 2010
    Posts
    62

    Re: Matching header data and returning all non-blank values?

    On a normal day, that was an awesome answer! This report is just a pain though.....thanks for trying MarvinP!~

  6. #6
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,567

    Re: Matching header data and returning all non-blank values?

    This proposed solution employs a helper row (1) on the Current State of Data sheet, which may be moved and/or hidden for aesthetic purposes.
    The formula that populates A1 is: =COUNT(A3:A25)
    The formula that populates B1:AE1 is: =SUM(COUNT(B2:B25),A1)
    On the Desired State sheet the array entered formula* that populates the Model column is:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    The formula that populates the Year column is:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    *Array entered formulas are confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.
    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ 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] Find matching header between two tables and returning that column's specific row value.
    By DaniLucas in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-14-2016, 11:03 AM
  2. Returning Blank Cells as errors when matching.
    By Fizban in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-21-2014, 04:12 AM
  3. Replies: 0
    Last Post: 09-28-2012, 07:55 AM
  4. matching data with header and place it below its header
    By bujji1305 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-04-2012, 02:51 AM
  5. [SOLVED] Returning and Counting matching values?
    By Laur3l in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 03-29-2012, 03:09 PM
  6. [SOLVED] Matching values & returning on the same row
    By Sharon in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-15-2005, 09:06 PM
  7. Matching cells & returning values
    By Sharon in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-10-2005, 11:06 AM

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