+ Reply to Thread
Results 1 to 3 of 3

IF formula?

  1. #1
    Registered User
    Join Date
    08-20-2015
    Location
    CA
    MS-Off Ver
    2007
    Posts
    2

    IF formula?

    Hello

    Thanks in advance for your help and support.

    Is there a formula that would accomplish the following?

    if tab 1, A4:37 = Diesel then the value from tab 2 cell e3 should appear in tab 1 column b
    if tab 1, A4:37 =Apples then the value from tab 2 cell e4 should appear in tab 1 column b
    if tab 1, A4:37 =tires then the value from tab 2 cell e5 should appear in tab 1 column b
    if tab 1, A4:37 =betty then the value from tab 2 cell e6 should appear in tab 1 column b

    Thank You
    James

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

    Re: IF formula?

    will this work for you? =IF(A4="Diesel",Tab2'!$E$3,IF(A4="Apples",Tab2'!$E$4,IF(A4="tires",Tab2'!$E$5,Tab2'!$E$6)))
    then dragged down to work for values in A5 through A37 which is what I'm assuming you mean by A4:37.

    EDIT: BTW, that formula assumes you only have four values to look at so the default is that betty would automatically pull in the value from E6, if you have others than you might need this instead...
    =IF(A4="Diesel",Tab2'!$E$3,IF(A4="Apples",Tab2'!$E$4,IF(A4="tires",Tab2'!$E$5,IF(A4="betty",Tab2'!$E$6,""))))
    this one defaults to blank if some other value rather than apples, diesel, betty or tires are in the cell.
    Last edited by Sam Capricci; 08-29-2015 at 09:57 PM.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,917

    Re: IF formula?

    Hi, welcome to the forum

    It looks like you are testing a range to see if it contains a criteria? If so, then perhaps this...

    if(countif('tab 1'!A4:37,"Diesel")>0,e3,if(countif("tab 1'!A4:37,"Apples")>0,e4..............................................)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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. Replies: 11
    Last Post: 06-06-2014, 03:34 PM
  2. how to hide formula in formula box, view lookup result in formula box?
    By vengatvj in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-14-2013, 04:06 PM

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