+ Reply to Thread
Results 1 to 5 of 5

Conditional VLOOKUP formula for certain 'conditions' ???

  1. #1
    Registered User
    Join Date
    01-14-2015
    Location
    Beja, Portugal
    MS-Off Ver
    2013
    Posts
    7

    Question Conditional VLOOKUP formula for certain 'conditions' ???

    Good morning guys
    This time i come with a question which i think you can solve fairly simply, but i have no idea how to pull it off, which is as follows...:


    IMAGE 1
    1.png


    IMAGE 2
    2.png

    Image 1 shows part of an Operation table in which the hours of machine work are taken into account to keep track of the costs associated to a certain Operation Number, and Image 2 shows part of the price (per hour) table for those machines.

    So currently for calculating the total cost of Type 2 Operations i use the following formula:
    Please Login or Register  to view this content.
    This will only get me the price info from the "below 8 hours" portion. Now what i wish to know (if it is possible , which i think it is) is, what formula should i use if for a certain Operation Number (which will be a Type 2 Operation), a certain machine works more than 8 hours (as shown in lines 3 and 4, or 5 and 6 of example image 1), i want the formula to automatically look up the price from column D of Example image 2 instead of column C.

    Now, how is that formula done, can someone enlighten me ?
    Last edited by jcabroxo; 03-03-2015 at 05:59 AM. Reason: Problem solved

  2. #2
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.96 for Mac MS 365
    Posts
    8,691

    Re: Conditional VLOOKUP formula for certain 'conditions' ???

    I wonder if making it an if then stmt would work. So for example, =if(Sheet1!D4>7:59:59;VLOOKUP(Sheet1!D4;Sheet2!$A$1:$D$15;4;0)*E4/0,041666667);VLOOKUP(Sheet1!D4;Sheet2!$A$1:$D$15;3;0)*E4/0,041666667)) (untested)
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  3. #3
    Registered User
    Join Date
    01-14-2015
    Location
    Beja, Portugal
    MS-Off Ver
    2013
    Posts
    7

    Re: Conditional VLOOKUP formula for certain 'conditions' ???

    That condition did not work for me, it doesn't return a valid value.

    Plus, i forgot to attach the actual document, it might help.

    exemplo.xlsx

  4. #4
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.96 for Mac MS 365
    Posts
    8,691

    Re: Conditional VLOOKUP formula for certain 'conditions' ???

    Thanks for posting a sample, now that I see it, try this formula... =IF(E2<8,VLOOKUP(D2,Sheet2!$A$1:$D$15,3,0)*E2/0.041666667,VLOOKUP(D2,Sheet2!$A$1:$D$15,4,0)*E2/0.041666667)
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    01-14-2015
    Location
    Beja, Portugal
    MS-Off Ver
    2013
    Posts
    7

    Re: Conditional VLOOKUP formula for certain 'conditions' ???

    I don't know if that works (suspect it doesn't), because in the meanwhile i figured out a solution to my problem.

    For anyone who might be interested, what i did was create a new column with a "concatenate" formula in column G, joining "machine" with "Operation no.", and put the following formula in the "price" cells (Example for line 1) :

    Please Login or Register  to view this content.
    Problem solved, thread may be closed

+ 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. Two Conditions in one formula in Conditional Formatting
    By itachi26 in forum Excel General
    Replies: 2
    Last Post: 05-13-2011, 10:05 PM
  2. Two conditions in formula Conditional Formatting
    By vdongen in forum Excel General
    Replies: 10
    Last Post: 10-16-2010, 12:03 PM
  3. Combining Conditions within conditional formula
    By NickHubble in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-23-2009, 12:00 PM
  4. Conditional Formatting - with two conditions within one formula
    By Doctor Drogba in forum Excel General
    Replies: 2
    Last Post: 11-07-2008, 05:25 AM
  5. Need formula - conditional formatting - ran out of conditions!
    By Sandy in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-09-2005, 09:05 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