+ Reply to Thread
Results 1 to 8 of 8

If header then - pick below row cell

  1. #1
    Registered User
    Join Date
    10-09-2014
    Location
    switzerland
    MS-Off Ver
    2010
    Posts
    15

    If header then - pick below row cell

    Dear all

    Im wonderin if there is a way to fill up the column based on/refering to headers in a spreadsheet/workbook.

    Lets say i have 2 workbooks, and im looking in sheet1 A2 if in sheets2 A:C a header is called "example" - if so, then fill up all row cells below that header.

    Is there a way by xls - or is/would that be already a macro thing...

    Any help much appreciated!

    thanks and regards

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: If header then - pick below row cell

    Please post a sample sheet ( no pics) - Much easier to work with

  3. #3
    Registered User
    Join Date
    10-09-2014
    Location
    switzerland
    MS-Off Ver
    2010
    Posts
    15

    Re: If header then - pick below row cell

    Just created a file to show exactly what i mean. hope its clear enough - otherwise let me knowtest headers.xlsx

  4. #4
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: If header then - pick below row cell

    try
    =INDEX(Sheet2!$A$3:$C$5,,MATCH(D$1,Sheet2!$A$2:$C$2,0))
    where
    Sheet1, C1: EXAMPLE1, D1: EXAMPLE2, E1: EXAMPLE3

    put it to Sheet1 A3, drag right and down
    Last edited by sandy666; 10-07-2015 at 05:06 AM.

  5. #5
    Registered User
    Join Date
    10-09-2014
    Location
    switzerland
    MS-Off Ver
    2010
    Posts
    15

    Re: If header then - pick below row cell

    thanks Sandy!!

    i have attached the spready... however, it only picks the first value, and not all till N/A.
    Attached Files Attached Files

  6. #6
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: If header then - pick below row cell

    lookup array cannot be source of lookup value
    =INDEX(Sheet2!$A$3:$C$5,,MATCH(Sheet2!B$2,Sheet2!$A2:$C2,0))
    see? everywhere you have Sheet2!... but where is sheet1 ?

    from my post above:
    =INDEX(Sheet2!$A$3:$C$5,,MATCH(D$1,Sheet2!$A$2:$C$2,0))
    and formula is inputed into Sheet1, so I don't have to use sheet1!D$1 because D$1 is in default sheet for formula.

    Definition:
    MATCH(lookup_value, lookup_array, [match_type])

    The MATCH function syntax has the following arguments:

    ## lookup_value Required. The value that you want to match in lookup_array. For example, when you look up someone's number in a telephone book, you are using the person's name as the lookup value, but the telephone number is the value you want.
    The lookup_value argument can be a value (number, text, or logical value) or a cell reference to a number, text, or logical value.

    ## lookup_array Required. The range of cells being searched.

    ## match_type Optional. The number -1, 0, or 1. The match_type argument specifies how Excel matches lookup_value with values in lookup_array. The default value for this argument is 1.

    EDIT:
    You need to define source of lookup value(s). Can be Sheet3, can be any other row everywhere but not in lookup array. You can define lookup value manually of course but it will block dragging formula to the left or right. If you have lookup array horizontally will be easier to have the same vector with source of lookup value.
    Last edited by sandy666; 10-07-2015 at 07:19 AM.

  7. #7
    Registered User
    Join Date
    10-09-2014
    Location
    switzerland
    MS-Off Ver
    2010
    Posts
    15

    Re: If header then - pick below row cell

    Thanks Sandy!!

    i will try it, even if i never understood the index/match thing.. however, i have created several sheets where i use index/match and they work... :D but i dont get it. something is not clear enough, or im just to stupid to get it.

    what i mean, and what i dont get, is that in my understanding it should be possible to look for (lets say) 3 values from "sheet1" in an array in "sheet2" - but all workbooks that i created where linkend like "look for value from sheet1 $A2 in sheet2 column $B - and i thouhgt i can look for value in sheet1 $A2 in sheet2 (array) $A1:$AD3000 - which never worked!

    if you have an answer on that, then you would def make my day! and all these sleepless nights were over! :D

  8. #8
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: If header then - pick below row cell


    I'll try to explain INDEX(), MATCH(), INDEX/MATCH and INDEX/MATCH/MATCH to you but exactly NOT() NOW(). IF(TIME>MIN,"Description about it","Need more TIME").
    Hope you'll be a little patient
    Maybe someone else will be faster and do this easier.
    regards
    sandy

+ 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. macro to lock cell by column header based on value in another cell by column header
    By Closet Guru in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-03-2015, 12:36 PM
  2. Pick diff pick list as per column value
    By ROHAN999 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 11-10-2013, 12:10 PM
  3. Trying to format a header to pick up verbiage from a cell.
    By cadamhill in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 04-04-2013, 09:07 AM
  4. Cell Data Header Only Shows Last Line of Multi-lined Cell Data Header
    By Jrub in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-09-2012, 05:40 PM
  5. Possible to find a cell based on a row header (col A) then a sub-row header (col B)
    By lifeboat in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-14-2011, 09:03 AM
  6. Excel 2007 : Pick-List pick fills in another cell
    By hpasso217 in forum Excel General
    Replies: 0
    Last Post: 02-28-2011, 05:38 PM
  7. [SOLVED] Select max value in a row and pick the column header
    By EK in forum Excel General
    Replies: 8
    Last Post: 07-21-2005, 10: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