+ Reply to Thread
Results 1 to 8 of 8

How to find cells ending with numbers and adding something to those cells

  1. #1
    Forum Contributor
    Join Date
    02-27-2009
    Location
    Chennai, India
    MS-Off Ver
    Excel 2013
    Posts
    327

    How to find cells ending with numbers and adding something to those cells

    Ref. Attachment.

    Column A has names. Victor + 1, Mary + 2, Jennie. I want them to be Victor + 1 person, Mary + 2 persons, Jennie respectively in column B. ie need to identify the cells in column A, ending with (singular / plural) numbers or alphabets and act accordingly.

    Thanks
    Attached Files Attached Files
    Last edited by jilaba; 07-27-2020 at 11:53 AM.
    Ask me how to hate XL.

  2. #2
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: How to find cells ending with numbers and adding something to those cells

    One way:=IF(ISNUMBER(VALUE(TRIM(RIGHT(SUBSTITUTE(A2," ",REPT(" ",255)),255)))),A2&IF(VALUE(TRIM(RIGHT(SUBSTITUTE(A2," ",REPT(" ",255)),255)))>1," Persons"," Person"),A2)
    Click the * to say thanks.

  3. #3
    Forum Contributor
    Join Date
    02-27-2009
    Location
    Chennai, India
    MS-Off Ver
    Excel 2013
    Posts
    327

    Re: How to find cells ending with numbers and adding something to those cells

    Quote Originally Posted by PaulM100 View Post
    One way:=IF(ISNUMBER(VALUE(TRIM(RIGHT(SUBSTITUTE(A2," ",REPT(" ",255)),255)))),A2&IF(VALUE(TRIM(RIGHT(SUBSTITUTE(A2," ",REPT(" ",255)),255)))>1," Persons"," Person"),A2)
    Thanks, it solved. Prompt reply.

  4. #4
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,742

    Re: How to find cells ending with numbers and adding something to those cells

    Excel 2016 (Windows) 32 bit
    A
    B
    1
    Name Results
    2
    Victor + 1 Victor + 1 Person
    3
    Mary + 2 Mary + 2 Persons
    4
    Jennie Jennie

    A
    B
    1
    Name Results
    2
    Victor + 1 =IFERROR(IF(FIND("+",A2),A2&" Person"&IF(RIGHT(TRIM(A2),1)*1>1,"s",""),""),A2)
    3
    Mary + 2 =IFERROR(IF(FIND("+",A3),A3&" Person"&IF(RIGHT(TRIM(A3),1)*1>1,"s",""),""),A3)
    4
    Jennie =IFERROR(IF(FIND("+",A4),A4&" Person"&IF(RIGHT(TRIM(A4),1)*1>1,"s",""),""),A4)
    Happy with my answer * Add Reputation.
    If You are happy with solution, please use Thread tools and mark thread as SOLVED.

  5. #5
    Valued Forum Contributor
    Join Date
    11-02-2016
    Location
    NY
    MS-Off Ver
    2010
    Posts
    459

    Re: How to find cells ending with numbers and adding something to those cells

    Put this formula in C2 =IF(ISNUMBER(VALUE(RIGHT(A2,1))),+A2&" Person",A2) - the formula is looking at if the last digit is numeric, if it is, it adds " Persons" to your original value. This will not make singular. It's a start

  6. #6
    Forum Contributor
    Join Date
    02-27-2009
    Location
    Chennai, India
    MS-Off Ver
    Excel 2013
    Posts
    327

    Re: How to find cells ending with numbers and adding something to those cells

    Quote Originally Posted by queuesef View Post
    Put this formula in C2 =IF(ISNUMBER(VALUE(RIGHT(A2,1))),+A2&" Person",A2) - the formula is looking at if the last digit is numeric, if it is, it adds " Persons" to your original value. This will not make singular. It's a start
    Thanks, anyway i need singular / plural specific.

  7. #7
    Forum Contributor
    Join Date
    02-27-2009
    Location
    Chennai, India
    MS-Off Ver
    Excel 2013
    Posts
    327

    Re: How to find cells ending with numbers and adding something to those cells

    Quote Originally Posted by KOKOSEK View Post
    Excel 2016 (Windows) 32 bit
    A
    B
    1
    Name Results
    2
    Victor + 1 Victor + 1 Person
    3
    Mary + 2 Mary + 2 Persons
    4
    Jennie Jennie

    A
    B
    1
    Name Results
    2
    Victor + 1 =IFERROR(IF(FIND("+",A2),A2&" Person"&IF(RIGHT(TRIM(A2),1)*1>1,"s",""),""),A2)
    3
    Mary + 2 =IFERROR(IF(FIND("+",A3),A3&" Person"&IF(RIGHT(TRIM(A3),1)*1>1,"s",""),""),A3)
    4
    Jennie =IFERROR(IF(FIND("+",A4),A4&" Person"&IF(RIGHT(TRIM(A4),1)*1>1,"s",""),""),A4)
    Thanks, But sometimes it is not returning the names without numbers. Anyway it was solved.

  8. #8
    Forum Contributor
    Join Date
    02-27-2009
    Location
    Chennai, India
    MS-Off Ver
    Excel 2013
    Posts
    327

    Re: How to find cells ending with numbers and adding something to those cells

    Thanks all, it was solved by first answer itself.

+ 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] Need help with adding up numbers that are conditional on 2 other cells.
    By Stalthos in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 12-08-2015, 04:08 AM
  2. [SOLVED] I canīt find numbers ending zero 0
    By virtualman in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 04-30-2015, 04:13 PM
  3. Replies: 3
    Last Post: 01-08-2014, 10:50 PM
  4. adding numbers in cells
    By comp23 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-22-2012, 05:09 PM
  5. Adding cells with numbers and cells with #NA
    By Hustad in forum Excel General
    Replies: 4
    Last Post: 09-23-2010, 01:23 AM
  6. [SOLVED] Adding numbers to several cells at one time
    By RagDyeR in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-06-2005, 07:05 AM
  7. [SOLVED] Adding numbers to several cells at one time
    By Bob in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 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