+ Reply to Thread
Results 1 to 3 of 3

Need to Pull Column Headers Into Each Row Based on Yes/No Value in the Column

  1. #1
    Registered User
    Join Date
    09-06-2017
    Location
    Los Angeles, CA
    MS-Off Ver
    Windows 2016
    Posts
    2

    Question Need to Pull Column Headers Into Each Row Based on Yes/No Value in the Column

    I have a list of 1,800 clients (column A) with sales commissions values (column B), and then columns C through Y are the salespersons with a Yes/No value in each of the 1800 rows indicating which salesperson (up to 3 per client row) has earned that commission.

    I would like to create a formula that would pull the header row 1 (salesperson names) into a cell to the right of the data sheet (column Z) when there is a Yes in that salespersons column for that client, and for additional salespeople that were associated with that client.

    So for example for client1 if we have salesperson1, salesperson3, and salesperson9 with a YES in the row associated with that client (ignoring all the columns with a "NO" value. The column Z value would then hopefully be "salesperson1, salesperson3, salesperson9". That way i could then use a pivot table to quickly sum all the of unique combinations and individual salesperson's commissions.

    I attached an image of a portion of the spreadsheet I'm working with, as well as the actual spreadsheet. The sheet has some VBA code in it that a friend was trying to help me out with but it seems to be returning all of the header values and all of the client row values, regardless of the Yes/No. If this can be done with a simpler formula instead that would be great, but any help or solutions would be greatly appreciated.

    Thank you!
    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor Maudibe's Avatar
    Join Date
    12-21-2016
    Location
    USA
    MS-Off Ver
    2010-2013
    Posts
    326

    Re: Need to Pull Column Headers Into Each Row Based on Yes/No Value in the Column

    Place the following code in a standard module
    Please Login or Register  to view this content.
    In cell Z2, enter the following formula then copy down
    =SalesReps(E2:Y2) where Columns E through Y and the Sales Rep Column (according to your image)

    HTH,
    Maud

  3. #3
    Registered User
    Join Date
    09-06-2017
    Location
    Los Angeles, CA
    MS-Off Ver
    Windows 2016
    Posts
    2

    Re: Need to Pull Column Headers Into Each Row Based on Yes/No Value in the Column

    Wow this worked beautifully. Thank you so much!

+ 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] pull email address from a column based on criteria from another column
    By cinstanl in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-09-2016, 08:09 AM
  2. Retrieve Column Headers Dynamically - Based on column Values
    By akshaysudhir in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-12-2016, 05:42 AM
  3. Sum based on repeating column headers
    By maw230 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-13-2015, 05:06 PM
  4. [SOLVED] Copy from one sheet to another based on column headers
    By in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-01-2014, 10:27 AM
  5. [SOLVED] listbox with column headers as a specific sheet column headers
    By ANDREAAS in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-07-2014, 04:40 AM
  6. [SOLVED] Move Data From One Column to Another based on column headers and Row Text
    By DerbysGal in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 02-10-2014, 07:21 AM
  7. return a value based on column and row headers
    By jimmy1981 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-01-2012, 11:02 AM

Tags for this Thread

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