Results 1 to 5 of 5
  1. #1
    Silver Lounger
    Join Date
    Dec 2000
    Location
    Northampton, Northamptonshire, England
    Posts
    1,951
    Thanks
    2
    Thanked 1 Time in 1 Post

    VLOOKUP problem (Excel 2002)

    Hi

    I need some help to populate the part of this formula where it says contains something else then do this.

    =IF(Market_Sector="processed_food",VLOOKUP(B7,Chem _Table,12,0)),IF(Market_Sector(contains something else then do this) (B7<>"",VLOOKUP(B7,Chem_Table,3,FALSE)," ")

    Market sector may sometimes be blank or contain something other than "processed food" I also need to get the B7<>"" in the first VLOOKUP formula

    Many Thanks

    Braddy
    If you are a fool at forty, you will always be a fool

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: VLOOKUP problem (Excel 2002)

    The syntax of the IF function is

    =IF(condition, result_if_true, result_if_false)

    so if you use Market_Sector="processed_food" as condition, you don't need to use IF(Market_Sector(contains something else ... further on, just use the result_if_false part.

    If I understand the intention of your attempt correctly, you can use this:

    <code>=IF(B7="","",VLOOKUP(B7,Chem_table,IF(Market _Sector="processed_food",12,3),FALSE))</code>

  3. #3
    Silver Lounger
    Join Date
    Dec 2000
    Location
    Northampton, Northamptonshire, England
    Posts
    1,951
    Thanks
    2
    Thanked 1 Time in 1 Post

    Re: VLOOKUP problem (Excel 2002)

    Hi Hans

    Thanks for your reply

    What I need to do is if Market_Sector is other than Processed_Food it should look in column 3 for a price, if it does contain Processed_Food then it should look in column 12.

    I have checked the range and it is correct. If use your formula and it is other than Processed_Food I get #Ref.

    Regards

    Braddy
    If you are a fool at forty, you will always be a fool

  4. #4
    Silver Lounger
    Join Date
    Dec 2000
    Location
    Northampton, Northamptonshire, England
    Posts
    1,951
    Thanks
    2
    Thanked 1 Time in 1 Post

    Re: VLOOKUP problem (Excel 2002)

    Hi Hans

    My sincere apologies my range was not correct and now of course the formula works.

    Many Thanks

    Braddy
    If you are a fool at forty, you will always be a fool

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: VLOOKUP problem (Excel 2002)

    The formula works correctly in the worksheet I created to test it. Could you attach a stripped down copy of your workbook?

    Added: I see that you already found the problem.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •