+ Reply to Thread
Results 1 to 7 of 7

Cell entries dependent on other cells

  1. #1
    Registered User
    Join Date
    04-18-2010
    Location
    Manchester
    MS-Off Ver
    Excel 2010
    Posts
    4

    Cell entries dependent on other cells

    Hello,

    not be on for a looong time, but am stuck and thought that someone with far superior knowledge would be able to help!

    Apologies for the ambiguous title, by the way!!!!!

    Thanks to all for their previous assistance.

    As an example, I have two columns in a simple spreadsheet..

    From what I input into A2 & B2, I want the result to show in C2. However, this should only be if they are equal.

    As an example:

    If A2 & B2 equal "A", then C2 will equal 1

    If A2 & B2 equal "B", then C2 will equal 2

    If A2 & B2 equal "C", then C2 will equal 3

    However, if A2 and B2 don't match, then C2 will stay blank.

    Thanks for having a look and thanks in advance for your assistance.

    Regards,

    Craig

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Cell entries dependant on other cells

    Try:

    =IF(A2=B2,LOOKUP(A2,{"A","B","C"},{1,2,3}),"")

    note: The first array in { } must be in ascending sorted order.
    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
    Join Date
    07-01-2010
    Location
    United States, Washington DC
    MS-Off Ver
    Excel 2007
    Posts
    116

    Re: Cell entries dependant on other cells

    How big of a spreadsheet are you working with?

  4. #4
    Registered User
    Join Date
    04-18-2010
    Location
    Manchester
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Cell entries dependant on other cells

    Quote Originally Posted by NBVC View Post
    Try:

    =IF(A2=B2,LOOKUP(A2,{"A","B","C"},{1,2,3}),"")

    note: The first array in { } must be in ascending sorted order.
    Thankyou for the above, it does work.

    However, when I copy the formula down, I get '#N/A'

    How could I get rid of that please?

    Sorry to be a pain!!!

  5. #5
    Registered User
    Join Date
    04-18-2010
    Location
    Manchester
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Cell entries dependant on other cells

    Quote Originally Posted by wmfinance View Post
    How big of a spreadsheet are you working with?
    It will be about 400 rows long maximum

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Cell entries dependant on other cells

    Quote Originally Posted by pie-eater View Post
    Thankyou for the above, it does work.

    However, when I copy the formula down, I get '#N/A'

    How could I get rid of that please?

    Sorry to be a pain!!!
    That is when both cells are blank?

    =IF(AND(A2="",B2=""),"",IF(A2=B2,LOOKUP(A2,{"A","B","C"},{1,2,3}),""))

    or

    =IF(A2=B2,LOOKUP(A2,{0,"A","B","C"},{"",1,2,3}),"")

  7. #7
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Cell entries dependent on other cells

    Your post does not comply with Rule 8 of our Forum RULES. Cross-posting is when you post the same question in other forums on the web. You'll find people are disinclined to respond to cross-posts because they may be wasting their time solving a problem that has been solved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser)to the cross-post. Expect cross-posts without a link to be closed a message will be posted by the moderator explaining why. We are here to help so help us help you!

    Read this to understand why we ask you to do this

    http://www.mrexcel.com/forum/showthread.php?t=482214

+ 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