+ Reply to Thread
Results 1 to 12 of 12

sum numbers not text

  1. #1
    Forum Contributor
    Join Date
    12-30-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    143

    sum numbers not text

    hi

    My data set looks as follows starting from Cell A1 going down

    1

    1

    2

    3

    d1

    h22

    x

    1%

    10.00%

    5%

    50

    I would like a subtotal in the last cell which would total 96

    i cannot use a helper colum it needs to be in one column

    it should ignore the percentage symbol and other text

  2. #2
    Forum Expert ben_hensel's Avatar
    Join Date
    01-26-2012
    Location
    Northeast USA
    MS-Off Ver
    Office 365
    Posts
    2,043

    Re: sum numbers not text

    SUM function already ignores text.

    Problem you've probably got is that "5%" probably isn't a text string with the "%" character on the end, it's the number 0.05 formatted as a percentage.

    Here's my first approximation of an answer:
    Please Login or Register  to view this content.
    This sums up all numbers in range A1:A100 that are at least 1. So 1, 500, or 3.14 would all be added up, but for example, 50% would be ignored (because 50% = 0.5).
    Note this means if you have something like 300% that will be included (because 300% = 3) and conversely per above if you have 0.5 you want included but 50% you don't in the same range, this wouldn't be able to tell the difference. And telling the difference is actually pretty hard; that's because excel functions aren't designed to care about the formatting, like % vs. decimal number or whatever.
    Last edited by ben_hensel; 06-08-2020 at 08:37 PM.
    Click the [* Add Reputation] Button to thank people for help!
    Post Attachment: Click [Go Advanced] under the reply box; then click [Manage Attachments] to launch the attachments dialogue.
    Mark Thread Solved: Go to the top of the first post; Select [Thread Tools] dropdown; Pick the [Mark thread as Solved] option.

  3. #3
    Forum Contributor
    Join Date
    12-30-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    143

    Re: sum numbers not text

    hi

    how about the d1 or h22 etc..
    Last edited by AliGW; 06-09-2020 at 01:47 AM. Reason: Please don't quote unnecessarily!

  4. #4
    Forum Contributor
    Join Date
    12-30-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    143

    Re: sum numbers not text

    i also can't have it ignore any number it shoulld sum all numbers including if there is a percantage symbol or not
    Last edited by AliGW; 06-09-2020 at 01:47 AM. Reason: Please don't quote unnecessarily!

  5. #5
    Forum Expert ben_hensel's Avatar
    Join Date
    01-26-2012
    Location
    Northeast USA
    MS-Off Ver
    Office 365
    Posts
    2,043

    Re: sum numbers not text

    Quote Originally Posted by BORUCH View Post
    how about the d1 or h22 etc..
    are... are these supposed to be references to other cells entered as text?

    Yikes that's foul

    Anyway you're going to have to create a helper cell and run an IF to test that with INDIRECT to see if text cells contain a valid cell or range reference.

    I don't think you can embed that in an array formula construction like {SUM(IF)} because that won't cooperate with a volatile function like INDIRECT.

  6. #6
    Forum Contributor
    Join Date
    12-30-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    143

    Re: sum numbers not text

    a helper colum will not work is there a vba or udf that can do the job ?

  7. #7
    Forum Contributor
    Join Date
    12-30-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    143

    Re: sum numbers not text

    Quote Originally Posted by ben_hensel View Post
    are... are these supposed to be references to other cells entered as text?
    no its no reference at all
    Last edited by AliGW; 06-09-2020 at 01:48 AM.

  8. #8
    Forum Expert ben_hensel's Avatar
    Join Date
    01-26-2012
    Location
    Northeast USA
    MS-Off Ver
    Office 365
    Posts
    2,043

    Re: sum numbers not text

    in that case why can't you just do a straight SUM(A1:A100) on it? Why doesn't that work?

  9. #9
    Forum Contributor
    Join Date
    12-30-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    143

    Re: sum numbers not text

    Quote Originally Posted by ben_hensel View Post
    in that case why can't you just do a straight SUM(A1:A100) on it? Why doesn't that work?
    because it won't sum the 1 after the d or the 22 after the h and it will not sum the 1% etc..

  10. #10
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,410

    Re: sum numbers not text

    Quote Originally Posted by BORUCH View Post
    a helper colum will not work is there a vba or udf that can do the job ?
    Give this UDF a try...
    Please Login or Register  to view this content.
    Simply give it the range to evaluate as its argument. For example...
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  11. #11
    Forum Contributor
    Join Date
    12-30-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    143

    Re: sum numbers not text

    perfect! that worked thanks alot

    just out of curiosty can this udf be repliacted in a regular excel formula using excel standard functions ?
    Last edited by AliGW; 06-09-2020 at 01:48 AM. Reason: Please don't quote unnecessarily!

  12. #12
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,410

    Re: sum numbers not text

    Quote Originally Posted by BORUCH View Post
    just out of curiosty can this udf be repliacted in a regular excel formula using excel standard functions ?
    No it can't, at least not as far as I know.

+ 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. Extract Text from Numbers Where Text and Numbers are Different # of Characters
    By EvolutionJulie in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-06-2019, 10:50 PM
  2. VBA to convert a range from numbers to numbers stored as text (Text to Columns)
    By tantcu in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-06-2017, 05:50 PM
  3. Replies: 11
    Last Post: 04-10-2017, 06:23 AM
  4. [SOLVED] make Userform entries with just numbers stay as text and not numbers upon pasting
    By vpan in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-01-2016, 02:13 PM
  5. [SOLVED] Marco to convert numbers stored as text to numbers and dates stored as text to numbers
    By a2424 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-22-2014, 10:19 AM
  6. [SOLVED] Convert all numbers stored as text or custom formatted to numbers &no decimals - 40 sheets
    By synses in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-19-2013, 01:46 AM
  7. Replies: 9
    Last Post: 03-26-2012, 02:16 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