+ Reply to Thread
Results 1 to 8 of 8

Display a value or text in a cell depending on value in another cell

  1. #1
    Registered User
    Join Date
    05-10-2013
    Location
    Belgrade
    MS-Off Ver
    Excel 2010
    Posts
    3

    Display a value or text in a cell depending on value in another cell

    Hello to all. I was wondering if anybody can help me. Here is the issue.
    I'm trying to create a function in Excel 2010 that would do the following:
    If cell B2 has no value the result displayed in C2 would be "/"
    If cell B2 has a value 9-72-21-01-R-001 the result in C2 would be ESM 72-21-01 R001
    If cell B2 has a value 9-72-21-01-R-145 the result in C2 would be ESM 72-21-01 R145

    Value in B2 is selected from drop-down many.

    Doc1.jpg


    Thanks!

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,463

    Re: Display a value or text in a cell depending on value in another cell

    =IF(B2="","/", If(B2="9-72-21-01-R-001"," ESM 72-21-01 R001",if(B2="9-72-21-01-R-145","ESM 72-21-01 R145","")))

    (perhaps replace commas with semi-colons per regional settings

  3. #3
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Display a value or text in a cell depending on value in another cell

    hi zoboran, welcome to the forum. try:
    =IF(B2="","/",IF(B2="9-72-21-01-R-001","ESM 72-21-01 R001","ESM 72-21-01 R145"))

    that is assuming you only have 3 types of values.

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  4. #4
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Display a value or text in a cell depending on value in another cell

    Perhaps..

    =if(b2="9-72-21-01-R-001";" ESM 72-21-01 R001";if(b2="9-72-21-01-R-145";"ESM 72-21-01 R145";"/"))
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  5. #5
    Registered User
    Join Date
    05-10-2013
    Location
    Belgrade
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Display a value or text in a cell depending on value in another cell

    hmmm, things are a bit more complicated.
    C2 cell is just an example.
    All the cells of column C should have a value dependent on corresponding B cell.
    And there are more than three value options. Would like to avoid typing the formula in the formula bar (too much time ). Is there a predefined function so that I can just copy-paste it?

  6. #6
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Display a value or text in a cell depending on value in another cell

    Create a table and then use INDEX & MATCH functions..

  7. #7
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,463

    Re: Display a value or text in a cell depending on value in another cell

    Quote Originally Posted by zoboran View Post
    hmmm, things are a bit more complicated.
    Why did I have this feeling.... ?

  8. #8
    Registered User
    Join Date
    05-10-2013
    Location
    Belgrade
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Display a value or text in a cell depending on value in another cell

    Thanks!
    Will try it

+ 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