+ Reply to Thread
Results 1 to 8 of 8

If Value in one cell = the value in another, then ...

  1. #1
    Registered User
    Join Date
    07-02-2010
    Location
    in your house
    MS-Off Ver
    Excel 2003
    Posts
    4

    If Value in one cell = the value in another, then ...

    Hi guys i am a very basic excel user and might only take u guys a min to help me out on this one, but any help will be appreciated.

    Lets say i have in A1, A2, A3

    TV
    BLURAY
    VCR

    and then prices for each in B1, B2, B3

    £500
    £200
    £100

    Now i create a dropdown list box in C1 which lets me select TV, BLURAY, VCR.

    i can do that bit fine, but now i want D1 to automatically fill the box with the value of the 'TV' (which is in cell B1 and is £500)

    im just stuck on the forumla, which in simple terms i guess is


    IF i select TV in the list box then D1 will copy the values of B1 (which is the price of the item) but if i select BLURAY in the list box then D1 will copy over the values of B2, and so forth.

    Thanks Guys

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,483

    Re: If Value in one cell = the value in another, then........Pls help

    Give This a go
    =IF(ISERROR(VLOOKUP(C1,$A$1:$B$3,2,0)),"",(VLOOKUP(C1,A1:B3,2,0)))

  3. #3
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: If Value in one cell = the value in another, then........Pls help

    I'm guessing that when you say "listbox" you mean a data validation dropdown list.
    If that's true, try this:

    D1: =VLOOKUP(C1,A1:B3,2.0)

    If you're unfamiliar with Data Validation....
    • Select C1
    • Data.Validation
    • Allow: List
    • Data: select the A1:A3 range
    • Click: OK

    Does that help?
    Last edited by Ron Coderre; 07-02-2010 at 07:56 AM. Reason: typing on the train is for the birds
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  4. #4
    Registered User
    Join Date
    07-02-2010
    Location
    in your house
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: If Value in one cell = the value in another, then........Pls help

    thanks dave, that was excellent...........i was attempting by myself for ages without any luck.

    your a life saver

  5. #5
    Registered User
    Join Date
    07-02-2010
    Location
    in your house
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: If Value in one cell = the value in another, then........Pls help

    thanks to you too ron, now i have a choice of two! lol

  6. #6
    Registered User
    Join Date
    07-02-2010
    Location
    in your house
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: If Value in one cell = the value in another, then........Pls help

    ok i have one more question the formula both of u have given me are working, but on this one:

    =IF(ISERROR(VLOOKUP(C1,$A$1:$B$3,2,0)),"",(VLOOKUP(C1,A1:B3,2,0)))

    my table array cells are A4-6 AND G4-6 Only, but when i try typing in

    (VLOOKUP(C1,$A$4:$G$6,2,0) it obviously highlights everything including B,C,D,E,F etc. is there any way i can just only get A and G in the array?

    Thanks again guys

  7. #7
    Registered User
    Join Date
    06-05-2010
    Location
    Fl, Usa
    MS-Off Ver
    Excel 2001
    Posts
    19

    Re: If Value in one cell = the value in another, then........Pls help

    Quote Originally Posted by ntdtyler View Post
    (VLOOKUP(C1,$A$4:$G$6,2,0) it obviously highlights everything including B,C,D,E,F etc. is there any way i can just only get A and G in the array?
    With the item in "A" and the price in "G", all you have to do is change the column index number in vlookup-(change the 2 to a 7). The column index number tells which column your price is in. The first column in the array is 1 the next 2 etc etc. so A is 1, G is 7

    Change this
    =VLOOKUP(C1;A4:G6;2;0)
    to this
    =VLOOKUP(C1;A4:G6;7;0)
    Last edited by spreadcore; 07-02-2010 at 08:52 AM.

  8. #8
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: If Value in one cell = the value in another, then........Pls help

    Spreadcore helped with the VLOOKUP part...

    Here's something else to consider:
    Since C1's value is controlled by a DV dropdown list,
    it can only contain a valid entry or a blank.

    Consequently, I believe this would work for you:
    D1: =IF(C1="","",VLOOKUP(C1,A4:G6,7,0)))

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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