+ Reply to Thread
Results 1 to 7 of 7

Formula to Display Cell Value/Text

Hybrid View

  1. #1
    Registered User
    Join Date
    08-20-2013
    Location
    Schenectady, NY
    MS-Off Ver
    Excel 2011 Mac
    Posts
    64

    Formula to Display Cell Value/Text

    Hi. I am trying to create a formula that would display the value or text of a cell based on criteria in another cell.

    Ex.

    ...A...B
    ..34..xl
    ..45....

    In the above table, whenever "xl" occurs in column B, the formula should display the value of the adjacent cell in column A, which would be "34".

    Is this even possible?

  2. #2
    Forum Contributor noboffinme's Avatar
    Join Date
    08-29-2013
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2003/7/10/13/16/19
    Posts
    1,071

    Re: Formula to Display Cell Value/Text

    Hi jhudson444,

    How about the below?


    =IF(B2="xl",A2,"")
    Remember you are unique, like everyone else

  3. #3
    Registered User
    Join Date
    08-20-2013
    Location
    Schenectady, NY
    MS-Off Ver
    Excel 2011 Mac
    Posts
    64

    Re: Formula to Display Cell Value/Text

    Thanks, that works.

    Now, if possible, is there a way apply that formula to a range of cells?

    Something like: =IF(B2:B3="xl",A2:A3," ")

    The problem with the above formula is that it will only work if it is placed in a cell that is adjacent to the cells that it is trying to calculate. If placed in other parts of the sheet, it will not work.
    Last edited by jhudson444; 10-24-2013 at 12:24 AM.

  4. #4
    Valued Forum Contributor
    Join Date
    10-29-2012
    Location
    Mojokerto,Indonesia
    MS-Off Ver
    Excel 2007
    Posts
    554

    Re: Formula to Display Cell Value/Text

    try this one
    =SUMPRODUCT((B2:B3="xl")*(A2:A3))

  5. #5
    Registered User
    Join Date
    08-20-2013
    Location
    Schenectady, NY
    MS-Off Ver
    Excel 2011 Mac
    Posts
    64

    Re: Formula to Display Cell Value/Text

    That works!

    The formula that you created will add up values in column A every time there is "xl" in the adjacent cell in column B.

    Is there any way to only display the most-recent value in column A when there is "xl" in column B?

    Ex.

    ...A.....B
    ..34....xl
    ..45....xl
    ..24....xl

    The formula should result in 24.

  6. #6
    Valued Forum Contributor
    Join Date
    10-29-2012
    Location
    Mojokerto,Indonesia
    MS-Off Ver
    Excel 2007
    Posts
    554

    Re: Formula to Display Cell Value/Text

    may be like this
    =INDEX($A$2:$A$4,MATCH("xl",$B$2:$B$4))

  7. #7
    Registered User
    Join Date
    08-20-2013
    Location
    Schenectady, NY
    MS-Off Ver
    Excel 2011 Mac
    Posts
    64

    Re: Formula to Display Cell Value/Text

    Thanks!

    That formula only looks for "xl". Is there a way to make it look for "xl" or "xb"?

    Ex.

    ...A.....B
    ..34....xb
    ..45....xl
    ..24....xb

    The result is still 24 even though there is "xb" next to it.
    Last edited by jhudson444; 10-24-2013 at 03:31 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 7
    Last Post: 09-03-2013, 04:43 PM
  2. If No - Hide certain cell text, If Yes display the text
    By Louie555 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-15-2013, 09:53 AM
  3. VBA - Import text from cell value and display in text box on cell mouse click
    By hemal89 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-29-2013, 07:20 AM
  4. [SOLVED] If text in two cells, display text in cell A.
    By Lome in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 05-30-2013, 06:20 PM
  5. [SOLVED] Find text within cell then display text to left
    By Jambruins in forum Excel General
    Replies: 5
    Last Post: 04-17-2006, 05:10 PM

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