+ Reply to Thread
Results 1 to 7 of 7

Looking for a formula that can identify which column value is being used per row value

  1. #1
    Registered User
    Join Date
    12-05-2017
    Location
    Glasgow,Scotland
    MS-Off Ver
    2014
    Posts
    15

    Lightbulb Looking for a formula that can identify which column value is being used per row value

    Good evening folks,

    Been a little while since I was on this forum but I was wondering if someone could help me out or point me in the right direction of solving this specific question I have.

    Basically I am looking for a formula that can go through this table I have created and identify which column header(Area) is being used as per the value inputted(x) below it in each row. I have attached a sample of the problem I am having and put a yellow column to the right hand side of how the formulas answer should be.

    Any help on this would be hugely appreciated guys and thanks for taking some time on having a look
    Attached Files Attached Files

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,986

    Re: Looking for a formula that can identify which column value is being used per row value

    Please Login or Register  to view this content.
    How to install your new code
    Copy the Excel VBA code
    Select the workbook in which you want to store the Excel VBA code
    Press Alt+F11 to open the Visual Basic Editor
    Choose Insert > Module
    Edit > Paste the macro into the module that appeared
    Close the VBEditor
    Save your workbook (Excel 2007+ select a macro-enabled file format, like *.xlsm)


    Then use this array-entered UDF:

    =ConcatAll(IF(C4:N4="x",$C$3:$N$3,"")," & ")



    Array Formulae are a little different from ordinary formulae in that they MUST be confirmed in the FIRST CELL ONLY by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. After that, the array can be dragged down as normal, to cover the desired range.

    You will know the array is active when you see curly brackets { } - or "curly braces" for those of you in the USA, or "flower brackets" for those of you in India - appear around the outside of your formula. If you do not use CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly brackets yourself - it won't work...
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Spammer
    Join Date
    01-08-2015
    Location
    Cali, Colombia
    MS-Off Ver
    365
    Posts
    302

    Re: Looking for a formula that can identify which column value is being used per row value

    Hi, to all!

    Another option could be this UDF:
    PHP Code: 
    Function JoinCond$(RngCond As RangeCond$, RngRes As RangeDelim$)
        
    Dim a&, d&, As Rangeaux
        
        a 
    Application.CountIf(RngCondCond)
        
    ReDim aux(1 To a)
        
        For 
    Each c In RngCond
            
    If LCase(c) = LCase(CondThen
                d 
    d
                aux
    (d) = RngRes(c.Row RngCond.Row 1_
                            c
    .Column RngCond.Column 1)
            
    End If
        
    Next c
        JoinCond 
    Join(auxDelim)
    End Function 
    And you can use like a Excel formula like this:
    [O4] : =JoinCond(C4:N4,"x",C$3:N$3," & ")

    Check file. Blessings!
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    12-05-2017
    Location
    Glasgow,Scotland
    MS-Off Ver
    2014
    Posts
    15

    Re: Looking for a formula that can identify which column value is being used per row value

    Really Appreciate the responses guys thanks so much . Im not very good when it comes to VBA but is there a way to have it so that it can pick up when the values of each rows are changed i.e added or removed ? When I try to mess around with inputting different (x) in different row boxes I am just faced with a !NAME error. Or parhaps I am just struggling to grasp certain aspects.

    Thanks none the less guys , you are all saints !

  5. #5
    Spammer
    Join Date
    01-08-2015
    Location
    Cali, Colombia
    MS-Off Ver
    365
    Posts
    302

    Re: Looking for a formula that can identify which column value is being used per row value

    Hi, Rybags!

    When you open the file, you must click on "Enable macros" in the yellow bar that appears at the top of the Excel workspace, so that the formula works for you. The NAME errors in Excel are because the functions used are not being recognized. Blessings!

  6. #6
    Forum Expert
    Join Date
    11-27-2007
    Location
    New Jersey, USA
    MS-Off Ver
    2013
    Posts
    1,669

    Re: Looking for a formula that can identify which column value is being used per row value

    Here's a solution without macros, just using formulas.
    You can add or delete (x) and it works.
    I am using some helper columns that you can hide.
    I have created formulas in five columns so it'll pick up upto five (x). You can extend the formulas to more columns and adjust formulas in answer column accordingly.
    Attached Files Attached Files
    1. Click on the * Add Reputation if you think this helped you
    2. Mark your thread as SOLVED when question is resolved

    Modytrane

  7. #7
    Forum Expert
    Join Date
    11-27-2007
    Location
    New Jersey, USA
    MS-Off Ver
    2013
    Posts
    1,669

    Re: Looking for a formula that can identify which column value is being used per row value

    Added & between areas in the answer column.
    Attached Files Attached Files

+ 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] Formula to identify duplicates in the same column
    By Stephen R in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-19-2015, 01:10 PM
  2. column comparison, trying to identify identify identical columns.
    By Jowel in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-24-2014, 04:12 AM
  3. [SOLVED] Formula to identify with row&column
    By kenadams378 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-02-2013, 04:45 PM
  4. [SOLVED] Identify the last filled row in Column A and then drag formula in Column B till the same
    By bonny24tycoon in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-13-2012, 10:50 AM
  5. Formula To Identify Text and Numbers from a column
    By SpAnKy in forum Excel General
    Replies: 7
    Last Post: 05-12-2010, 12:39 AM
  6. [SOLVED] Formula to Identify Column Number
    By Michael Link in forum Excel General
    Replies: 4
    Last Post: 08-14-2005, 11:05 AM
  7. [SOLVED] Formula to identify a keyword in all cells of a column
    By HTC in forum Excel General
    Replies: 3
    Last Post: 07-28-2005, 11:05 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