Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Adding multiple numbers in one cell

2,966 views
Skip to first unread message

pandd15

unread,
Sep 8, 2009, 4:23:43 PM9/8/09
to
My spreadsheet contains multiple numbers in one cell they are all seperated
by a coma. Is there a formula that will add these numbers?

87563, 8930, 98279 are in one cell I'd like to have the total in another
colum, the total of numbers not the sum, e.g. 3

Thanks,

T. Valko

unread,
Sep 8, 2009, 4:49:55 PM9/8/09
to
One way...

The formula *must* be entered in the cell to the immediate right of the cell
that you want to sum. For example:

E1 = 87563, 8930, 98279

The formula *must* be entered in cell F1.

Create this named formula.
Select cell B1. ***this is important***
Goto the menu Insert>Name>Define
Name: ESum (or whatever name you want to use)
Refers to:

=EVALUATE(SUBSTITUTE(A1,",","+"))

OK out

Then:

E1 = 87563, 8930, 98279

Enter this formula in **F1** :

=ESum

--
Biff
Microsoft Excel MVP


"pandd15" <pan...@discussions.microsoft.com> wrote in message
news:C320B08F-CC79-42BD...@microsoft.com...

Glenn

unread,
Sep 8, 2009, 5:06:50 PM9/8/09
to


=SUMPRODUCT(--TRIM(MID(SUBSTITUTE(A1,", ",REPT(" ",99)),
(99*(ROW(INDIRECT("1:"&LEN(A1)-LEN(SUBSTITUTE(A1,",",""))+1))-1))+1,99)))

T. Valko

unread,
Sep 8, 2009, 5:13:53 PM9/8/09
to
Another option that isn't so rigid in its implementation...

Download and install the free Morefunc.xll add-in from:

http://xcell05.free.fr/morefunc/english/index.htm

Alternate download site:

http://www.download.com/Morefunc/3000-2077_4-10423159.html

The use this formula (entered anywhere!):

=EVAL(SUBSTITUTE(E1,",","+"))

--
Biff
Microsoft Excel MVP


"T. Valko" <biffi...@comcast.net> wrote in message
news:OjO1sXMM...@TK2MSFTNGP05.phx.gbl...

pandd15

unread,
Sep 9, 2009, 3:32:15 PM9/9/09
to
I tried this one =EVALUATE(SUBSTITUTE(A1,",","+")) , I must be doing
something wrong. I am new to Excel so I must be missing something. In this
example what would the formula look like? The amount of numbers in C will
vary in each row.

a b c
d
1 700-2, 88-00,
900-4, 33-00,

2


3

Thanks so much.

T. Valko

unread,
Sep 9, 2009, 3:42:14 PM9/9/09
to
>700-2, 88-00,
>900-4, 33-00,

>>Is there a formula that will add these numbers?
>>87563, 8930, 98279

The "numbers" you just posted don't look anything like the the numbers you
posted in your original sample!

What are the dashes for?

If these are the numbers:

>700-2, 88-00,
>900-4, 33-00,

Then what results do you expect?

What about that last comma? If there is not another number why is it there?

--
Biff
Microsoft Excel MVP


"pandd15" <pan...@discussions.microsoft.com> wrote in message

news:0074A42A-1C91-460D...@microsoft.com...

pandd15

unread,
Sep 9, 2009, 3:59:19 PM9/9/09
to
My appologies for not doing a good job of explaining; these numbers are
product #'s, and vary in format, some with dashes some without, they also
vary in the amount of numerals and some have letters. I am interested only
in the total of numbers, as in 4 for the example below. They will always
have a coma and space between the numbers.

Thanks for your quick response.

Glenn

unread,
Sep 9, 2009, 4:18:53 PM9/9/09
to
Count the commas.

=LEN(A1)-LEN(SUBSTITUTE(A1,",",""))

T. Valko

unread,
Sep 9, 2009, 4:46:14 PM9/9/09
to
>I am interested only in the total of numbers,
>as in 4 for the example below.
>>700-2, 88-00,
>>900-4, 33-00,

Ok, so this leaves me even more confused!

If the result you expect is 4 then you must want to COUNT the "numbers", not
SUM them.

If that's the case then counting the number of commas will work as long as
every cell is in the same format:

number, number,

If you also have cells like this:

number
number, number

Then you'll have to let us know.

--
Biff
Microsoft Excel MVP


"Glenn" <add...@not.valid> wrote in message
news:O4nzjqYM...@TK2MSFTNGP04.phx.gbl...

pandd15

unread,
Sep 10, 2009, 8:39:01 AM9/10/09
to
The counting comma's works great but unfortunately there are many numbers
that don't have comma's after the last #.

Glenn

unread,
Sep 10, 2009, 9:50:20 AM9/10/09
to
Let's assume that there is at least one (and maybe more) spaces between each
"number". Count them and add one.

=LEN(TRIM(A1))-LEN(SUBSTITUTE(TRIM(A1)," ",""))+1

Lori Miller

unread,
Sep 10, 2009, 11:09:02 AM9/10/09
to
Maybe this to sum all numbers in A1 (with any non-numeric delimiter):

=SUMPRODUCT(TEXT(MID(A1&".",257-COLUMN(A:IV),1),"0;;0;\0")*10^(COLUMN(A:IV)-
LOOKUP(COLUMN(A:IV),COLUMN(A:IV)/ISERR(-MID(A1&".",257-COLUMN(A:IV),1)))-1))

pandd15

unread,
Sep 10, 2009, 11:26:10 AM9/10/09
to
Thanks Lori but by add I mean the total of numbers not the sum, e.g. 87346-1,
838473, 93759-1 = 3 there are usually more than 3 in a cell, I use 3 merely
as an example.

Thanks,

Lori Miller

unread,
Sep 10, 2009, 11:38:01 AM9/10/09
to
To count numbers contained in A1 (with comma or any other delimiter) try:

=SUM(--(FREQUENCY(COLUMN(A:IV),COLUMN(A:IV)*ISERR(-MID("."&A1&".",COLUMN(A:IV),1)))>1))

Lori Miller

unread,
Sep 10, 2009, 11:46:01 AM9/10/09
to
Should have read more carefully, if it's only comma separated, perhaps

=LEN(TRIM(SUBSTITUTE(A1,","," ")))-LEN(SUBSTITUTE(TRIM(SUBSTITUTE(A1,",","
"))," ",""))+1

pandd15

unread,
Sep 15, 2009, 9:50:01 AM9/15/09
to
Thanks Lori and everyone else for all the help. I have another question
about this same spreadsheet.

I have dates in several columns that track how long a processes take. These
dates are manually added however the process may still be incomplete thus
leaving a blank in that column. These blank columns are causing my
calculations to have incorrect #'s. Is there a way I can leave a cell blank
without having this happen?

Glenn

unread,
Sep 15, 2009, 10:03:16 AM9/15/09
to
pandd15 wrote:
> Thanks Lori and everyone else for all the help. I have another question
> about this same spreadsheet.
>
> I have dates in several columns that track how long a processes take. These
> dates are manually added however the process may still be incomplete thus
> leaving a blank in that column. These blank columns are causing my
> calculations to have incorrect #'s. Is there a way I can leave a cell blank
> without having this happen?
>


Probably, but without more information about your data layout and existing
formulas, a specific answer is not likely.

0 new messages