Return all column names of the cells that match a value in a single cell

I want to be able to scan all the cells in column 1 in column 3 (there could be several) which belong to the same line and check if they all have a value y (X). If they have no value, I want all columns to display all the names of the matching columns as follows: "column 1, column 2" for Elemento.

This can be a good start:

B2 = if (counta (C2) > 0, C$ 1, "" ") & IF (COUNTA (D2) > 0', ' & D$ 1," ") & IF (COUNTA (E2) > 0', ' & E$ 1," "") & IF (COUNTA (F2) > 0', '& F$ 1,' ')

It's shorthand dethrone select cell C2, then type (or copy and paste it here) the formula:

= IF (counta (C2) > 0, C$ 1, "" ") & IF (COUNTA (D2) > 0', ' & D$ 1," ") & IF (COUNTA (E2) > 0', ' & E$ 1," "") & IF (COUNTA (F2) > 0', '& F$ 1,' ')

Select cell B2, copy

Select the cells B2 the bottom of column D, dough

To add additional columns, you copy the atomic unit:

& IF (COUNTA (D2) > 0', '& D$ 1,' ')

and update D2 with the new column and D$ 1 with the new column.

then... If you add a new column (G, for example) that you want to change it:

and IF (COUNTA (D2) > 0', '&D$1,' ')

TO

and IF (COUNTA (G2) > 0', "&G$1," ")

and the updated formula would be:

= IF (counta (C2) > 0, C$ 1, "" ") & IF (COUNTA (D2) > 0', ' & D$ 1," ") & IF (COUNTA (E2) > 0', ' & E$ 1," "") & IF (COUNTA (F2) > 0', ' & F$ 1,"") & IF (COUNTA (G2) > 0', '& G$ 1,' ')

fill down like before

Tags: iWork

Similar Questions

  • Discovered lines with column names where the cell contains a value

    I have a table with columns Additive_ID, A, B, C. Each Additive_ID has a single row.

    I would like to write a query that returns a result set with two columns: Additive_ID and values. It will have up to three lines for each Additive_ID, with the values column that contains the name of the column in the source table if it contains a 1 for this Additive_ID.

    What is the best way to achieve this?

    (In fact, the source table contains about 50 columns.)
    Select additive_id, decode(A,1,'A') value from your_table union all
    Select additive_id, decode(B,1,'B') value from your_table union all
    Select additive_id, decode(C,1,'C') value from your_table
    

    Here's a quick way to get all the SELECT to build the union:

    Select 'Select additive_id, decode('||column_name||',1,'''||column_name||''') value from your_table union all'
    from cols
    where table_name = 'YOUR_TABLE';
    

    Max

  • How to make reference to a column name in the form report

    Hello
    How can I make reference to a column name in the form report. My problem is that "I have a form report that I have the column name when using click on the column name, it must get to the next page with the corresponding values of the column".

    Here, I realized that when I click on the name of the column (in page 1) it brings me to the next page (page 2). but in the next page (P2) I want to display (display only) the corresponding values of the column (page 1) selected, but the values are not editable and shouldn't be in the text box must be in display area.

    So, how can I write a SQL to display single source field. That is to say, how can I consult report form (page 1) in name column.

    Hello

    If you use the link in the column when you click on the need of the column value, you need to navigate to the next page and all the data accordingly select value here.

    Modify the report form and see the top of the page and click on report attribute.

    So now you have the attributes of the columns is to say what are the columns are available in the reports form.

    Click on change column what you need Ie the column when you click on its passage to the next page this column, for example, as mentioned in the previous post "Empname".

    Check the link column and give perspective of values according to your need and click on apply chages.

    Thank you & best regards
    Srikkanth.M

  • Anyway, to remove the column names in the result of the query of SQLPLUS

    Hello

    I am using sqlplus to run a script that returns results with the column names.

    Anyway is to omit the names of columns in the result of the sqlplus query?

    I would like to have only results with their column names in the output.

    Thanks in advance!

    Hello

    Maybe your LINES (IZE) is not defined?

    SCOTT>set lines 130
    SCOTT>select status, machine, module
      2    from v$session
      3   where upper(username) = 'SCOTT';
    
    STATUS   MACHINE                                                          MODULE
    -------- ---------------------------------------------------------------- ------------------------------------------------
    INACTIVE PFAE3\VPC4894-03                                                 TOAD 9.7.2.5
    ACTIVE   PFAE3\VPC4894-03                                                 SQL*Plus
    
    2 rows selected.
    
    SCOTT>
    

    As an alternative to the linesize parameter, you can format the columns:

    SCOTT>set lines 80
    SCOTT>col status for a8
    SCOTT>col machine for a30
    SCOTT>col module for a30
    SCOTT>select status, machine, module
      2    from v$session
      3   where upper(username) = 'SCOTT';
    
    STATUS   MACHINE                        MODULE
    -------- ------------------------------ ------------------------------
    INACTIVE PFAE3\VPC4894-03               TOAD 9.7.2.5
    ACTIVE   PFAE3\VPC4894-03               SQL*Plus
    
    2 rows selected.
    
    SCOTT>
    

    Concerning
    Peter

  • Display the name of the tag as the column name and the value in the tag as a row of data from the input string.

    Hi Forum members,

    I am looking for a query display the name of the tag as the column name and the value in the tag as a row of data.

    I have to print the values within the tag to a file by choosing the value of the flags. the sequence of the tags will vary each time, as the tag name will change dynamically.

    So here is the example of input data and the expected output. The string in the text column must be separated as the column names and values.

    Input data
    Select 1 as seqno,' < > 0210A 50 4f < / 4f > < 5f20 > TEST CARD 16 < / 5f20 > < 5f2a > < / 5f2a > < 82 > 1 c 00 < / 82 > ' double text


    Output:

    Seqno 4f 5f20 5f2a 82
    0210A 50 16 1 00 TEST CARD 1

    Please help me by providing your entries on this.

    We use the version of Oracle 11.2.

    Note: This is not the XML string

    Thank you

    Shree

    with

    data in the form of

    (select 1 as seqno,'<4f>0210 A 50<5f20>TEST CARD 16<5F2a><82>00 1' text of all the double union)

    Select 2 as seqno,'XYZ<4F>0210 A 50<5f20>TEST CARD 16<5f2a><82>00 1' text of all the double union

    Select 3 as seqno,'<4f>0210 A 50<5f20>TEST CARD 16<5F2A><82>1 00XYZ ' text of all the double union

    Select option 4 as seqno,'<4F>0210 A 50<5F20>TEST CARD 16<5f2A><82>1 00XYZ' double text

    )

    Select d.seqno, x.*

    d the data,

    XMLTable ('/ root')

    by the way xmltransform (xmltype ('': replace (replace (text,'<><>'),)))

    XmlType (q'~http://www.w3.org/1999/XSL/Transform "version ="1.0"> ")

                                                     

                                                       

                                                         

                                                       

                                                     

                                                     

                                                       

                                                         

                                                       

                                                     

    ~'

    )

    )

    path of columns '4f' varchar2 (10) "tag4f."

    path of "5f20' varchar2 (30)"tag5f20. "

    path of '5f2a' varchar2 (10) "tag5f2a."

    path of varchar2 (10) "82" "tag82.

    ) x


    SEQNO 4f 5f20 5f2a 82
    1 0210A 50 16 TEST CARD - 1 00
    2 0210A 50 16 TEST CARD - 1 00
    3 0210A 50 16 TEST CARD - 1 00
    4 0210A 50 16 TEST CARD - 1 00

    with

    data in the form of

    (select 1 as seqno,'<4f>0210 A 50<5f20>TEST CARD 16<5F2a><82>00 1' text of all the double union)

    Select 2 as seqno,'XYZ<4F>0210 A 50<5f20>TEST CARD 16<5f2a><82>00 1' text of all the double union

    Select 3 as seqno,'<4f>0210 A 50<5f20>TEST CARD 16<5F2A><82>1 00XYZ ' text of all the double union

    Select option 4 as seqno,'<4F>0210 A 50<5F20>TEST CARD 16<5f2A><82>1 00XYZ' double text

    ),

    Chopper (seqno, Key, value, String) as

    (select seqno,

    regexp_substr (text,'<(.+?)>', 1, 1, null, 1),

    regexp_substr (Text,'>(.*?))

    regexp_substr (text,'<.+?>. *? ) (.*) $', 1, 1, null, 1). » <>'

    from the data

    Union of all the

    Select seqno,

    regexp_substr (String,'<(.+?)>', 1, 1, null, 1),

    regexp_substr (String,'>(.*?))

    regexp_substr (String,'<.+?>. *? ) (.*) $', 1, 1, null, 1)

    Chopper

    where regexp_substr (string,'<(.*?)>', 1, 1, null, 1) is not null

    )

    Select '4f', seqno, '5f2a', '82', '5f20.

    of (seqno, lower (key) select key, value)

    Chopper

    )

    Pivot (max (value) for key in ('4f' as '4f', '5f20' as '5f20', '5f2a' as '5f2a', "82" as "82"))

    Concerning

    Etbin

  • Display the column name of the column more recently updated

    I wonder if it is possible to display the name of the column in the column most recently updated in a table.

    Example:

    Emp table

    Name

    Height

    Weight

    Age

    Update_Date

    Update_Column

    Original record (03/20/14)

    Name size weight Age Update_date Update_Column

    John                                                 03/20/14          Name

    Then someone comes and update the height on 22/03/14:

    Name size weight Age Update_date Update_Column

    John 5'9 03/22/14 height

    And the Update_date and the Update_column would change again if someone came and put a value for the age. And so on.

    Is this possible?

    Also, if the above is possible, would it be possible to display the name of extreme right column if a user updated several columns at the same time?

    Example:

    User updates the sub-folder:

    Name size weight Age Update_date Update_Column

    John 5'9 03/22/14 height

    And adds weight and age at the same time on 24-03-14:

    Name size weight Age Update_date Update_Column

    John 5'9 150 31 03/24 / 14

    The Update_Column would display age because it is the furthest to the right. (Think by reading from left to right, the column that has been updated if the extreme right)

    So to sum things, I need to be able to display Updated_date (which will be the date of the day when the record is the last updated) and Updated_Col (which is the column name of the column was last updated, and if multiple columns are updated then display that value has been updated last in)

    I hope that the examples help to clarify things.

    Thank you

    Steven

    I think I found a solution.

    delimiter //
    create table a (
      id int (10) unsigned auto_increment,
      a int(10),
      b int(10),
      update_date datetime NULL,
      update_column varchar(16) NULL,
      primary key (id)
    )//

    create trigger bu_a before update on a for each row begin
      set NEW.update_date = NOW();
      set NEW.update_column = NULL;
      -- you need to start with the rightmost column if you want
      -- that matched with the highest priority
      if OLD.b != NEW.b then
       set NEW.update_column = "b";
      elseif OLD.a != NEW.a then
       set NEW.update_column = "a";
      end if;
    end //

    TEST

    insert into a (id,a,b) values (1,1,1), (2,1,1), (3,1,1), (4,1,1)[
    update a set b = 2 where id = 2;
    update a set a = 2 where id = 3;
    update a set a = 2 where id = 4;
    update a set b = 2 where id = 4;
    select * from a;

    DISPLAY

    ID  A   B   UPDATE_DATE                    UPDATE_COLUMN
    1   1   1   (null)                          (null)
    2   1   2   March, 24 2014 23:22:33+0000      b
    3   2   1   March, 24 2014 23:22:33+0000      a
    4   2   2   March, 24 2014 23:22:33+0000      b

  • Is it possible to get the name of the folder that contains the current document?

    Hi all!


    I know how to get the name of the active document


    app.activeDocument.name;


    but I was wondering if you could also get the name of the folder that contains the current document. Not sure if this is possible or not, so I thought I'd ask, if so it save me a lot of time.


    Thanks in advance!

    Hi djbgraphicdesign,

    does this work for you?

    if (app.activeDocument.saved){
    alert(app.activeDocument.path.name);
    }
    

    Have fun

  • Getting the name of the Action that runs this script

    If I create an action in photoshop to run a script named "test script", how can determine within the "test script" what name of the action started to run this script?  I am writing a script to resize my images.  The scale will be determined by what Action ran this script.

    Example of

    Action names are 5 x 7, 4 x 6, 8 x 10

    Reproduced above action will run the same script, called "scale me."

    In "scale me ', the java code will determine that 4 x 6 started running" scale me. "

    "Level I" will go to the section in the java code to the scale of the image loaded into Photoshop for a 4 x 6 size.

    The reason for writing the code "scale me" in this way, is that I can keep only one script to resize my images.

    Any suggestion or help would be appreciated.

    Raymond

    I don't know of all average direct to determine the name of the action that began a script. You can find the name of the action highlighted / selected with this code.

    var ref = new ActionReference();
    ref.putEnumerated( charIDToTypeID("Actn"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
    var desc = executeActionGet(ref);
    var actionName = desc.getString( charIDToTypeID("Nm  ") );
    var actionSetName = desc.getString( charIDToTypeID("PrNm") );
    alert( 'Current selected action is: '+actionName+'\rin the action set: '+actionSetName );
    

    But it is not infallible.

    A better solution would be to set up your script to make it recordable action. The details are in the script as "JavaScript"resource guide. It you have that in place any action that registers the script you will store the values used. When the action is played again once you get these the app.playbackParameters calues. Image and layers of export files are two Adobe scripts that use a javascriptresource section.

  • What is the sql SELECT statement to list all service names in the database?

    What is the sql SELECT statement to list all service names in the database?

    I tried
    SELECT name FROM dba_services
    But a long with valid service, he list also some other documents that are not the names of services.

    Hello

    You can try this query:

    select name, value from v$parameter where name = 'service_names';
    

    Hope this helps.
    Best regards
    Jean Valentine

  • How can I connect my Mac to a network server? As in windows yo go to my computer / connection to a network drive, and then you select a letter and write the name of the server that you want to be logged

    I'm trying to adapt Windows to my new MacBook Pro with OS El Capitan.

    I work remotely for a company and I want to connect my Mac to the server of the company.

    My question is how to connect a MAc to a network drive with the permanently available connection.  For example, in my old HP I went to my computer / connection to a network drive. I've selected a letter and note the name of the server that I wanted to be connected to. The connection was then shown with my other drive hard 'sections '; I want to say C:, D: (for recovery), e: (for tools) and then connecting to the external server has been shown with the selected letter.

    There is no "letter" under OS X. It's a hangover very old of BACK, devices of mapping and volumes labeled mailbox.

    If you are connected to your corporate network, you should see the available network volumes listed in the Finder, in ' my computer > network ", or with the command K to connect to a server.

    You can create an alias for the volume and put it in the Dock, or leave on the desktop or put it somewhere else, and the next time you want to connect to this subject, simply double-click on it. You can also add the server address to your "favourites" in the connect to Server dialog box.

  • When I opened the window "save the Page under", the drop-down box file name indicates the files that have been saved a long time ago. It is not cleared by a function 'clear history' that I can find. How can I erase this?

    1. Question

    When I opened the window "save the Page under", the drop-down box file name indicates the files that have been saved a long time ago. It is not cleared by a function 'clear history' that I can find. How can I erase this?

    Hello.

    I think this is a related issue of Windows, because it is the Manager to save the windows file that we are talking about here (right?). You should contact Microsoft for help with this one, I think. You expect to be able to delete entries simply by touching delete on your keyboard when they are concentrated (that is how it goes for the removal of the form entries specific autocomplete in Firefox), but I have not tried.

    I'm sorry I can't be more helpful.

  • Could you please tell me the name of the program that plays the files (mp3) begins with V and resembles a cone orange and white?

    Could you please tell me the name of the program that plays the files (mp3) begins with V and resembles a cone orange & white?

    VLC.

    http://www.videolan.org/VLC/

  • What is the name of the table that has the name of the custom in the Oracle database Section?

    What is the name of the table that has the name of the custom in the Oracle database Section?

    Thank you

    Nefertari

    The names of the custom Sections are stored in commonExtendedAttributeML, the extended attribute table.

  • How can I get rid of the blue name and the date that is entered under the signature

    How can I get rid of the blue name and the date that is entered under the signature

    Yes! you see Configure text where you can uncheck date Logo etc...

    For more information, see image

  • new to 4.02, no grid or column names in the query results

    It is a bit strange, I have SQL Developer 4.02 just installed, and I don't see grid or column names in the query results.  Don't see anything useful in tools > Preferences, what don't get me?

    The worksheet gives you a couple of different ways to run a query...

    1. instruction execute sheet icon toolbar (large green arrow, or Ctrl + Enter).

    This produces a results tab of the query with the data displayed in a grid.

    2. worksheet icon toolbar Execute the Script (the small tip of the green arrow on lined paper, or F5).

    This produces a tab out of the Script with the data displayed on the printer.

    If execution of the statement to Execute the Script, using some SQL * most orders will remove the column headers:

    1. set the position

    2. set the pagesize 0 (or 1 or 2).

    Pagesize and linesize default is - 1.  By default, the spreadsheet is free for formatting output script as he wishes.  If you have not changed these settings in the spreadsheet, then see if you point to a startup script in Tools > Preferences > Database > name of the connection startup script file

    Kind regards

    Gary

    SQL DeveloperTeam

Maybe you are looking for