Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

excel formula help

  • 03-10-2012 10:32am
    #1
    Registered Users, Registered Users 2 Posts: 127 ✭✭


    Hi,
    I am trying to get a formula to return one value when you enter another value.

    For example, if you enter "Egg" in one cell, I want it to return the value "milk" in the cell next to it, if you enter "spoon" i want it to return the value "fork" in the cell.

    Does anyone know a formula that can do this? I used the Match formula for numbers but it wont work with text? Any ideas?


Comments

  • Registered Users, Registered Users 2 Posts: 2,677 ✭✭✭PhoenixParker


    vlookup

    write a table with egg, spoon etc. in one column and milk, fork etc. in the second column

    then it's =vlookup(*box with the word you want to look up*,*co-ordinates of whole table making sure you use $ signs to keep it from changing as you drag the box down*,*column number of the column you want the second cell to have which in this case should be 2*)

    Quick Edit - make sure to sort the table you make alphabetically.


  • Registered Users, Registered Users 2 Posts: 2,367 ✭✭✭fionny


    If its all pre-defined just do a vlookup?


  • Registered Users, Registered Users 2 Posts: 127 ✭✭montzarella


    ok, i'll try the vlookup, i might be back for help though, i find vlookups a bit confusing, thanks


  • Registered Users, Registered Users 2 Posts: 2,670 ✭✭✭Peppa Pig


    You need to use the VLOOKUP function. Difficult to explain in a single post. Try this link - long but you can follow it


  • Registered Users, Registered Users 2 Posts: 2,367 ✭✭✭fionny


    Learning to use Vlookups effectivley is a life skill, well worth knowing them back the front.


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 127 ✭✭montzarella


    ok, got the vlookup to work.

    another quick question...

    the formula will appear in the cells as #N/A until a value is entered, then it populates with the value...is there a way to make the cell be blank and not display the #N/A, even though the formula is there...?


  • Registered Users, Registered Users 2 Posts: 2,367 ✭✭✭fionny


    Use

    =iferror(<your vlookup>,"")

    This only works in newer versions of excel though.

    So

    =iferror(vlookup(a1,SHEET1,2,false),"") will return a blank cell if it gets #N/A or any other error. You can modify the last part to be whatever you want.


  • Registered Users, Registered Users 2 Posts: 2,677 ✭✭✭PhoenixParker


    The link provided by peppa pig provides a solution, which I think works in older versions of excel.
    It's the iffblank function.

    You put an if statement in first that checks if the cell is blank, if it is it returns a blank cell, if it's not it performs the vlookup function.


  • Registered Users, Registered Users 2 Posts: 2,367 ✭✭✭fionny


    2007 Up is fine for my version though and it way less fussy then the ifblank one!


  • Closed Accounts Posts: 971 ✭✭✭Senecio


    fionny wrote: »
    Learning to use Vlookups effectivley is a life skill, well worth knowing them back the front.

    Not wanting to confuse the OP, but using the compound functions of INDEX and MATCH is worth learning. It provides the ability to return columns to the left of the search column and addresses memory more efficiently meaning faster calculations for large files and smaller overall file sizes.

    It's worth looking into for anyone who relies heavily on Vlookups.

    http://www.mrexcel.com/articles/excel-vlookup-index-match.php


  • Advertisement
Advertisement