+ Reply to Thread
Results 1 to 13 of 13

Multiple If Commands

  1. #1
    Registered User
    Join Date
    02-19-2007
    Posts
    30

    Multiple If Commands

    Hi everyone,

    I have had a look on the forum for an answer to my problem and could do with some help.

    I know a little about Excel but not a vast amount.

    I am trying to select an item from a list in say A1 then A2 would automatically display the item description and A3 would display the price.

    Is there a way i could do this.

    Your help would be most greatly appreciated

    Kindest Regards
    Mark

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    You need to use Data Validation to create your drop down list....

    see here for how: http://www.contextures.com/xlDataVal01.html#Create

    Then you can use a Vlookup formula to get corresponding data from a table you have somewhere on the sheet.... see Vlookup in Excel help files for details.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Try vlookup

    http://datapigtechnologies.com/flashfiles/vlookup.html

    http://www.auditexcel.co.za/lookupandreference.html

    http://www.contextures.com/xlFunctions02.html

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  4. #4
    Registered User
    Join Date
    02-19-2007
    Posts
    30

    VLookup

    Hi thanks for your post, i have visited the links and they explain further regarding the VLOOKUP tool i am still confused as a list is what i need. I understand about validation and how to put a list together but i'm unsure as to what code to use to tell B2 and C2 to put a result depending on the contents of A2.

    Many thanks

    Mark

  5. #5
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    You put the Vlookup in B2 and C2.

    E.g

    =vlookup(A1,Your Table,2,false)
    Where
    A1 is the lookup value
    Your table range is the table of answers
    2 is Column 2
    False returns a exact match

    So if you looked up Cat in A1 it would go to the table and if it found the word cat it would return what is in Col 2 of the table

    VBA Noob

  6. #6
    Registered User
    Join Date
    02-19-2007
    Posts
    30

    VLookup

    Hi thank you very much it works great so easy when you have experts guiding you in the right direction.

    One further thing how would i make it so that the fields in a2, a3 etc appeared blank until the information was inserted in a1?

    Thanks very much for all your help.

  7. #7
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Try

    =IF(ISNA(VLOOKUP(A1,Your Table,2,FALSE)),"",VLOOKUP(A1,Your Table,2,FALSE))
    VBA Noob

  8. #8
    Registered User
    Join Date
    02-19-2007
    Posts
    30

    VLookup Excellent Response

    Wow thank you, so much easier than i thought.

    I have 1 final column with a total price in i get a #VALUE! when there is nothing entered in the fields containing the VLOOKUP fields

    Is it possible to make this field invisible until the selection is made in A1?

    I again thank you for your time and patience

    kind Regards
    Mark

  9. #9
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Replace ISNA with ISERROR

    =IF(ISERROR(VLOOKUP(A1,Your Table,2,FALSE)),"",VLOOKUP(A1,Your Table,2,FALSE))
    VBA Noob

  10. #10
    Registered User
    Join Date
    02-19-2007
    Posts
    30

    Vlookup

    Thank you for your very fast response,

    I am manually entering a qty needed in a seperate column, this will be multiplied by the result in A4 my formula as =suma5*A4, when a value is displayed in a4 it works fine but when nothing is there it says #VALUE! this is my problem.
    Apologies for not being slightly more specific.


    Many Thanks

    Mark

  11. #11
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Again use a if statement

    =IF(ISERROR(A5*A4),"",A5*A4)
    VBA Noob

  12. #12
    Registered User
    Join Date
    02-19-2007
    Posts
    30

    Smile VLOOKUP sorted

    Thank you very much it works a treat,

    Anyone reading this post will find it most helpful i did

    Thanks Again

    Mark :-)

  13. #13
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Your welcome

    VBA Noob

+ 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