+ Reply to Thread
Results 1 to 11 of 11

Complicated IF function...?

  1. #1
    Registered User
    Join Date
    06-05-2015
    Location
    Ontario, Canada
    MS-Off Ver
    2007
    Posts
    5

    Complicated IF function...?

    I have a spreadsheet with multiple tabs.
    One tab is a material list and another tab is a contract.
    I want to create a formula that will lookup if there is a number in the quantity column on the material list tab and enter the material name on the contract tab.
    So it will only enter the material information on the contract (tab) if the quantity is more than zero.
    I don't want any materials on the contract that are not being used...

    I hope this makes sense... lol
    Thx!

  2. #2
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,412

    Re: Complicated IF function...?

    Hi and welcome to the forum,

    It probably makes sense... but it would be much better if you could upload a workbook with sample data and expected results.
    Otherwise, it's difficult to give you a precise answer...
    GC Excel

    If this post helps, then click the star icon (*) in the bottom left-hand corner of my post to Add reputation.

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

    Re: Complicated IF function...?

    See if you can adapt this...

    Lookup with multiple instances of the lookup value
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  4. #4
    Registered User
    Join Date
    06-05-2015
    Location
    Ontario, Canada
    MS-Off Ver
    2007
    Posts
    5

    Re: Complicated IF function...?

    I attached the file I am working on.
    So if there is a number in Column B on the Materials tab, I want it to show up on the Contract tab under A24, and list all the materials that have an amount.
    I have tried an IF function, VLOOKUP and LOOKUP. It will only find the last material item that has a quantity, not the first one or the rest...
    Thx!
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    06-05-2015
    Location
    Ontario, Canada
    MS-Off Ver
    2007
    Posts
    5

    Re: Complicated IF function...?

    I also tried
    =IFERROR(INDEX(Materials!A4:Materials!A72,SMALL(IF(Materials!B$4:Materials!B$72>0,ROW(Materials!B$4:Materials!B$72)),ROWS(Contract!A$24:Contract!A24))),"")
    which only returned the value of A24 in the Materials tab...

  6. #6
    Registered User
    Join Date
    06-05-2015
    Location
    Ontario, Canada
    MS-Off Ver
    2007
    Posts
    5

    Re: Complicated IF function...?

    I also tried
    =LOOKUP("zzzzz",CHOOSE({1,2},"",INDEX(Materials!A:Materials!A,SMALL(IF(Materials!B$4:Materials!B$72>0,ROW(Materials!B$4:Materials!B$72)),ROWS(A$26:A26)))))
    which only returned a blank cell...

  7. #7
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Complicated IF function...?

    I don't know where you want the formula but this works as far as I can see from your formula in msg #5

    Array Enter this (Ctrl + Shift + Enter)
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

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

    Re: Complicated IF function...?

    Try it like this...

    First...

    Unmerge the cells on row 24 (A24:E24)
    Move the cell that says Labour.

    This array formula** entered in A24:

    =IFERROR(INDEX(Materials!A:A,SMALL(IF(Materials!B$4:B$72>0,ROW(Materials!B$4:B$72)),ROWS(A$24:A24))),"")

    ** 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.

    Copy down until you get blanks.

  9. #9
    Registered User
    Join Date
    06-05-2015
    Location
    Ontario, Canada
    MS-Off Ver
    2007
    Posts
    5

    Re: Complicated IF function...?

    Thanks Tony! That worked!

  10. #10
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Complicated IF function...?

    Now, take a look at the formula that Tony wrote in Msg #8 and mine in Msg #7 and compare them with your own formula in msg #5. You were oh so close.

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

    Re: Complicated IF function...?

    You're welcome. Thanks for the feedback!


    If your question has been solved please mark the thread as being solved.

    In the menu bar above the very first post select Thread Tools, then select Mark this thread as solved.

+ 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. Complicated IF function with example
    By ruthyeh in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-21-2013, 06:40 PM
  2. Complicated IF function
    By ruthyeh in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-21-2013, 10:59 AM
  3. Help with a complicated IF function
    By este994 in forum Excel General
    Replies: 17
    Last Post: 04-20-2011, 07:10 AM
  4. A Complicated Look up Function?
    By screamnyak in forum Excel General
    Replies: 2
    Last Post: 02-24-2011, 01:01 PM
  5. Complicated function; Can it be done?
    By The Boy in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-30-2007, 08:10 AM

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