+ Reply to Thread
Results 1 to 5 of 5

If B2 = 1 then pull data into sheet 2, if B2 is blank skip to next 1

  1. #1
    Registered User
    Join Date
    08-20-2012
    Location
    High Wycombe, England
    MS-Off Ver
    Excel 2010
    Posts
    46

    If B2 = 1 then pull data into sheet 2, if B2 is blank skip to next 1

    Hi guys,

    I've got 2 sheets, the first has a list of all our products and the user puts a 1 in column B if they want said product. The second sheet should then just bring in the lines that the user selected.

    What I'm trying to get is some form of formula that will look in column B and when it equals 1 to then bring in column A, if B doesn't equal 1 then it skips on to the next row until it finds a 1.


    I've attached an example to try to illistrate what I'm looking for.

    Thanks in advance


    example 30-04-13.xlsx
    Please add Rep if I've helped

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: If B2 = 1 then pull data into sheet 2, if B2 is blank skip to next 1

    hi djauncey, try this array formula:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    ...confirmed by pressing CTRL-SHIFT-ENTER to activate the array. 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. Press F2 on that cell and try again. extend the range if needed

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: If B2 = 1 then pull data into sheet 2, if B2 is blank skip to next 1

    Try in A2 and copy down this ARRAY (see my Signature)formula.

    =IFERROR(INDEX('Product Selection'!$A$2:$A$100,SMALL(IF('Product Selection'!$B$2:$B$100=1,ROW('Product Selection'!$A$2:$A$100)-1),ROW('Product Selection'!A1))),"")
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: If B2 = 1 then pull data into sheet 2, if B2 is blank skip to next 1

    This array formula** entered in A2 and copied down until you get blanks:

    =IFERROR(INDEX('Product Selection'!A:A,SMALL(IF('Product Selection'!B$2:B$8=1,ROW('Product Selection'!B$2:B$8)),ROWS(A$2:A2))),"")

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    Registered User
    Join Date
    08-20-2012
    Location
    High Wycombe, England
    MS-Off Ver
    Excel 2010
    Posts
    46

    Re: If B2 = 1 then pull data into sheet 2, if B2 is blank skip to next 1

    Excellent thank you both for your quick replies, works like a charm

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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