+ Reply to Thread
Results 1 to 7 of 7

adding text to cell

  1. #1
    Registered User
    Join Date
    06-10-2013
    Location
    Australia
    MS-Off Ver
    Excel 2007 and 2010
    Posts
    13

    adding text to cell

    Hello,
    i am having problems solving this formula.
    i need to check cells A1 to A5 if any of these cells have a 12 in them i need to return a "Inter" text
    so in b 7 i have =if(a1:a5=12,"inter",0)
    this does not work gives an error
    but if i move it to under any one of the cells a1 to a5 if works only for the cell it is under.


    this is the long formula that works but i would like a short one if possible

    =IF(A1=12,"inter",IF(B1=12,"inter",IF(C1=12,"inter",IF(D1=12,"inter",IF(E1=12,"inter",0)))))

    Thanks

  2. #2
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,915

    Re: adding text to cell

    Try
    =IF(COUNTIF(A1:A5,12),"Inter","0") or
    =IF(COUNTIF(A1:E1,12),"Inter","0")
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  3. #3
    Registered User
    Join Date
    06-10-2013
    Location
    Australia
    MS-Off Ver
    Excel 2007 and 2010
    Posts
    13

    Re: adding text to cell

    Thanks that got it, didnt realise i could use the countif for that.
    Thanks heaps

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: adding text to cell

    Quote Originally Posted by nflsales View Post
    Try
    =IF(COUNTIF(A1:A5,12),"Inter","0") or
    =IF(COUNTIF(A1:E1,12),"Inter","0")
    Probably don't want to quote the 0.

    =IF(COUNTIF(A1:A5,12),"Inter",0)

    =IF(COUNTIF(A1:E1,12),"Inter",0)
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,915

    Re: adding text to cell

    Quote Originally Posted by Tony Valko View Post
    Probably don't want to quote the 0.

    =IF(COUNTIF(A1:A5,12),"Inter",0)

    =IF(COUNTIF(A1:E1,12),"Inter",0)
    You are right, by mistake it happened

  6. #6
    Registered User
    Join Date
    06-10-2013
    Location
    Australia
    MS-Off Ver
    Excel 2007 and 2010
    Posts
    13

    Re: adding text to cell

    Yes thanks saw that and removed before pasting..
    tried with after seeing post and works either way.
    so it all good

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: adding text to cell

    Good deal. Thanks for the feedback!

+ 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. [SOLVED] Adding text to a cell based on specific text characters in another cell
    By JohnnyBoyxxx in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-29-2014, 06:03 PM
  2. [SOLVED] adding text in front of potentially existing text (in 1 cell) with IF/THEN statement
    By Marijke in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-10-2014, 04:20 AM
  3. Adding text to the start and end of a cells text in another cell
    By kubelwagon in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 11-29-2013, 06:36 PM
  4. [SOLVED] assigning number to text in a cell then adding a range together in another cell
    By joe malik in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-12-2013, 01:12 AM
  5. Change date into text if <today and adding text if cell isblank... into an Array.
    By JasonNeedsHelp in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-29-2013, 12:06 PM
  6. Replies: 5
    Last Post: 12-19-2012, 09:16 AM

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