Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Help! I need a formula to add numbers separated by commas within

Hello. I have a spreas sheeit in which each cell has various number
seperated with commas. For e.g. 100, 200, 300, 400 are in one cell. I have
an entire worksheet in which each cell has multiple numbers and I need for
each cell to be summed up individually. So if I have 100, 200, 300 in a
cell, I need it to add up and read 600. I can go into each cell individually
and enter the =sum but that would take me forever with an entire spread
sheet. Is there a way I can highlight the spreadsheet and enter a formula
that will automatically add up each individual cell so I don't have to enter
=sum in each individual cell?

I hope I'm being clear. Please help!
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default Help! I need a formula to add numbers separated by commas within

Is it an option to split the data into 4 columns? Data/Text To
Columns/Delimited, delimiter = ","

ensure the columns to the right of your data are empty (when the data gets
split, it will overwrite whatever is in the adjacent columns), select your
data, separate the data using text to columns, then just use the sum function
and copy it as far down or across as needed. keep a backup in case of
mishaps.


"SUPER EA" wrote:

Hello. I have a spreas sheeit in which each cell has various number
seperated with commas. For e.g. 100, 200, 300, 400 are in one cell. I have
an entire worksheet in which each cell has multiple numbers and I need for
each cell to be summed up individually. So if I have 100, 200, 300 in a
cell, I need it to add up and read 600. I can go into each cell individually
and enter the =sum but that would take me forever with an entire spread
sheet. Is there a way I can highlight the spreadsheet and enter a formula
that will automatically add up each individual cell so I don't have to enter
=sum in each individual cell?

I hope I'm being clear. Please help!

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 733
Default Help! I need a formula to add numbers separated by commas within

SUPER EA <SUPER wrote...
Hello. I have a spreas sheeit in which each cell has various number
seperated with commas. For e.g. 100, 200, 300, 400 are in one
cell. . . . I need for each cell to be summed up individually. So
if I have 100, 200, 300 in a cell, I need it to add up and read 600.

....

Define the name seq referring to the formula

=ROW(INDEX(Sheet2!$1:$65536,1,1):INDEX(Sheet2!$1:$ 65536,64,1))

then try the array formula

=SUM(IF(MID(","&A1,seq,1)=",",--MID(A1,seq,FIND(",",A1&",",seq)-seq)))

For example, if A1 contained 47, 94, 4, 65, 471, 487, this formula
returns 1168.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Help! I need a formula to add numbers separated by commas within

SUPER EA

Select the cells and run this macro.

Sub SUM_Add()
Dim myStr As String
Dim cel As Range
For Each cel In Selection
If Not cel.Formula Like "=SUM(*" Then
myStr = Right(cel.Formula, Len(cel.Formula) - 1)
cel.Value = "=SUM(" & myStr & ")"
End If
Next
End Sub


Gord Dibben MS Excel MVP

On Wed, 25 Jul 2007 17:20:02 -0700, JMB wrote:

Is it an option to split the data into 4 columns? Data/Text To
Columns/Delimited, delimiter = ","

ensure the columns to the right of your data are empty (when the data gets
split, it will overwrite whatever is in the adjacent columns), select your
data, separate the data using text to columns, then just use the sum function
and copy it as far down or across as needed. keep a backup in case of
mishaps.


"SUPER EA" wrote:

Hello. I have a spreas sheeit in which each cell has various number
seperated with commas. For e.g. 100, 200, 300, 400 are in one cell. I have
an entire worksheet in which each cell has multiple numbers and I need for
each cell to be summed up individually. So if I have 100, 200, 300 in a
cell, I need it to add up and read 600. I can go into each cell individually
and enter the =sum but that would take me forever with an entire spread
sheet. Is there a way I can highlight the spreadsheet and enter a formula
that will automatically add up each individual cell so I don't have to enter
=sum in each individual cell?

I hope I'm being clear. Please help!


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default Help! I need a formula to add numbers separated by commas wit

Seems like it would work, except it's not adding the numbers correctly.

When using this on my example of 100, 200, 300 in cell A1, after running the
macro, the formula displayed above reads: =sum(0, 200, 300) ......the cell
then reads the total of 500




"Gord Dibben" wrote:

SUPER EA

Select the cells and run this macro.

Sub SUM_Add()
Dim myStr As String
Dim cel As Range
For Each cel In Selection
If Not cel.Formula Like "=SUM(*" Then
myStr = Right(cel.Formula, Len(cel.Formula) - 1)
cel.Value = "=SUM(" & myStr & ")"
End If
Next
End Sub


Gord Dibben MS Excel MVP

On Wed, 25 Jul 2007 17:20:02 -0700, JMB wrote:

Is it an option to split the data into 4 columns? Data/Text To
Columns/Delimited, delimiter = ","

ensure the columns to the right of your data are empty (when the data gets
split, it will overwrite whatever is in the adjacent columns), select your
data, separate the data using text to columns, then just use the sum function
and copy it as far down or across as needed. keep a backup in case of
mishaps.


"SUPER EA" wrote:

Hello. I have a spreas sheeit in which each cell has various number
seperated with commas. For e.g. 100, 200, 300, 400 are in one cell. I have
an entire worksheet in which each cell has multiple numbers and I need for
each cell to be summed up individually. So if I have 100, 200, 300 in a
cell, I need it to add up and read 600. I can go into each cell individually
and enter the =sum but that would take me forever with an entire spread
sheet. Is there a way I can highlight the spreadsheet and enter a formula
that will automatically add up each individual cell so I don't have to enter
=sum in each individual cell?

I hope I'm being clear. Please help!





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Help! I need a formula to add numbers separated by commas within

Here's another way.

Assume:

A1 = 100, 200, 300

Enter this formula in B1:

="=SUM("&SUBSTITUTE(A1," ","")&")"

This will return a *text string* that looks like a formula:

=SUM(100,100,100)

To convert it to a real formula and get a numeric result:

With B1 still selected goto EditCopy then EditPaste SpecialValuesOK then
EditReplace

Find what: =
Replace with: =
Replace (or Replace all if you do a group of cells at once)
Close

--
Biff
Microsoft Excel MVP


"SUPER EA" <SUPER wrote in message
...
Hello. I have a spreas sheeit in which each cell has various number
seperated with commas. For e.g. 100, 200, 300, 400 are in one cell. I
have
an entire worksheet in which each cell has multiple numbers and I need for
each cell to be summed up individually. So if I have 100, 200, 300 in a
cell, I need it to add up and read 600. I can go into each cell
individually
and enter the =sum but that would take me forever with an entire spread
sheet. Is there a way I can highlight the spreadsheet and enter a formula
that will automatically add up each individual cell so I don't have to
enter
=sum in each individual cell?

I hope I'm being clear. Please help!



  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Help! I need a formula to add numbers separated by commas wit

Apologies

SUM_Add was originally another routine.

I forgot to remove the "-1" that the other needed. Try this revision.

Sub SUM_Add()
Dim myStr As String
Dim cel As Range
For Each cel In Selection
If Not cel.Formula Like "=SUM(*" Then
myStr = Right(cel.Formula, Len(cel.Formula))
cel.Value = "=SUM(" & myStr & ")"
End If
Next
End Sub


Gord

On Wed, 25 Jul 2007 20:40:01 -0700, SUPER EA
wrote:

Seems like it would work, except it's not adding the numbers correctly.

When using this on my example of 100, 200, 300 in cell A1, after running the
macro, the formula displayed above reads: =sum(0, 200, 300) ......the cell
then reads the total of 500




"Gord Dibben" wrote:

SUPER EA

Select the cells and run this macro.

Sub SUM_Add()
Dim myStr As String
Dim cel As Range
For Each cel In Selection
If Not cel.Formula Like "=SUM(*" Then
myStr = Right(cel.Formula, Len(cel.Formula) - 1)
cel.Value = "=SUM(" & myStr & ")"
End If
Next
End Sub


Gord Dibben MS Excel MVP

On Wed, 25 Jul 2007 17:20:02 -0700, JMB wrote:

Is it an option to split the data into 4 columns? Data/Text To
Columns/Delimited, delimiter = ","

ensure the columns to the right of your data are empty (when the data gets
split, it will overwrite whatever is in the adjacent columns), select your
data, separate the data using text to columns, then just use the sum function
and copy it as far down or across as needed. keep a backup in case of
mishaps.


"SUPER EA" wrote:

Hello. I have a spreas sheeit in which each cell has various number
seperated with commas. For e.g. 100, 200, 300, 400 are in one cell. I have
an entire worksheet in which each cell has multiple numbers and I need for
each cell to be summed up individually. So if I have 100, 200, 300 in a
cell, I need it to add up and read 600. I can go into each cell individually
and enter the =sum but that would take me forever with an entire spread
sheet. Is there a way I can highlight the spreadsheet and enter a formula
that will automatically add up each individual cell so I don't have to enter
=sum in each individual cell?

I hope I'm being clear. Please help!




  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default Help! I need a formula to add numbers separated by commas wit

I WANT TO THANK EVERYONE FOR THEIR VERY HELPFUL SUGGESTIONS. I TRIED THEM
ALL SO THANK YOU. I HAD THE BEST RESULTS USING GORD'S BELOW.
THANK YOU SO MUCH GORD!!! IT WORKED LIKE A CHARM.

"Gord Dibben" wrote:

Apologies

SUM_Add was originally another routine.

I forgot to remove the "-1" that the other needed. Try this revision.

Sub SUM_Add()
Dim myStr As String
Dim cel As Range
For Each cel In Selection
If Not cel.Formula Like "=SUM(*" Then
myStr = Right(cel.Formula, Len(cel.Formula))
cel.Value = "=SUM(" & myStr & ")"
End If
Next
End Sub


Gord

On Wed, 25 Jul 2007 20:40:01 -0700, SUPER EA
wrote:

Seems like it would work, except it's not adding the numbers correctly.

When using this on my example of 100, 200, 300 in cell A1, after running the
macro, the formula displayed above reads: =sum(0, 200, 300) ......the cell
then reads the total of 500




"Gord Dibben" wrote:

SUPER EA

Select the cells and run this macro.

Sub SUM_Add()
Dim myStr As String
Dim cel As Range
For Each cel In Selection
If Not cel.Formula Like "=SUM(*" Then
myStr = Right(cel.Formula, Len(cel.Formula) - 1)
cel.Value = "=SUM(" & myStr & ")"
End If
Next
End Sub


Gord Dibben MS Excel MVP

On Wed, 25 Jul 2007 17:20:02 -0700, JMB wrote:

Is it an option to split the data into 4 columns? Data/Text To
Columns/Delimited, delimiter = ","

ensure the columns to the right of your data are empty (when the data gets
split, it will overwrite whatever is in the adjacent columns), select your
data, separate the data using text to columns, then just use the sum function
and copy it as far down or across as needed. keep a backup in case of
mishaps.


"SUPER EA" wrote:

Hello. I have a spreas sheeit in which each cell has various number
seperated with commas. For e.g. 100, 200, 300, 400 are in one cell. I have
an entire worksheet in which each cell has multiple numbers and I need for
each cell to be summed up individually. So if I have 100, 200, 300 in a
cell, I need it to add up and read 600. I can go into each cell individually
and enter the =sum but that would take me forever with an entire spread
sheet. Is there a way I can highlight the spreadsheet and enter a formula
that will automatically add up each individual cell so I don't have to enter
=sum in each individual cell?

I hope I'm being clear. Please help!




  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 57
Default Help! I need a formula to add numbers separated by commas wit

Hi

For a formula method, as opposed VBA code you could use the following method

With your cursor in cell B1
InsertNameDefine Name Addcell Refers to
=EVALUATE(SUBSTITUTE(Sheet1!$A1,", ","+"))

In cell B1 enter
=Addcell and copy down


--
Regards
Roger Govier



"SUPER EA" wrote in message
...
I WANT TO THANK EVERYONE FOR THEIR VERY HELPFUL SUGGESTIONS. I TRIED THEM
ALL SO THANK YOU. I HAD THE BEST RESULTS USING GORD'S BELOW.
THANK YOU SO MUCH GORD!!! IT WORKED LIKE A CHARM.

"Gord Dibben" wrote:

Apologies

SUM_Add was originally another routine.

I forgot to remove the "-1" that the other needed. Try this revision.

Sub SUM_Add()
Dim myStr As String
Dim cel As Range
For Each cel In Selection
If Not cel.Formula Like "=SUM(*" Then
myStr = Right(cel.Formula, Len(cel.Formula))
cel.Value = "=SUM(" & myStr & ")"
End If
Next
End Sub


Gord

On Wed, 25 Jul 2007 20:40:01 -0700, SUPER EA

wrote:

Seems like it would work, except it's not adding the numbers correctly.

When using this on my example of 100, 200, 300 in cell A1, after running
the
macro, the formula displayed above reads: =sum(0, 200, 300) ......the
cell
then reads the total of 500




"Gord Dibben" wrote:

SUPER EA

Select the cells and run this macro.

Sub SUM_Add()
Dim myStr As String
Dim cel As Range
For Each cel In Selection
If Not cel.Formula Like "=SUM(*" Then
myStr = Right(cel.Formula, Len(cel.Formula) - 1)
cel.Value = "=SUM(" & myStr & ")"
End If
Next
End Sub


Gord Dibben MS Excel MVP

On Wed, 25 Jul 2007 17:20:02 -0700, JMB
wrote:

Is it an option to split the data into 4 columns? Data/Text To
Columns/Delimited, delimiter = ","

ensure the columns to the right of your data are empty (when the data
gets
split, it will overwrite whatever is in the adjacent columns), select
your
data, separate the data using text to columns, then just use the sum
function
and copy it as far down or across as needed. keep a backup in case
of
mishaps.


"SUPER EA" wrote:

Hello. I have a spreas sheeit in which each cell has various
number
seperated with commas. For e.g. 100, 200, 300, 400 are in one
cell. I have
an entire worksheet in which each cell has multiple numbers and I
need for
each cell to be summed up individually. So if I have 100, 200, 300
in a
cell, I need it to add up and read 600. I can go into each cell
individually
and enter the =sum but that would take me forever with an entire
spread
sheet. Is there a way I can highlight the spreadsheet and enter a
formula
that will automatically add up each individual cell so I don't have
to enter
=sum in each individual cell?

I hope I'm being clear. Please help!






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pasting Numbers with Commas from Outside Source Lou Giele Excel Discussion (Misc queries) 3 August 15th 06 07:01 PM
find and replace - replace data in rows to separated by commas msdker Excel Worksheet Functions 1 April 15th 06 01:00 AM
Count comma separated numbers, numbers in a range with dash, not t Mahendra Excel Discussion (Misc queries) 0 August 8th 05 05:56 PM
how to count occurence of numbers separated by , in a single cell kish20 Excel Worksheet Functions 3 June 10th 05 07:49 AM
many numbers in one cell separated by hyphen. baju Excel Discussion (Misc queries) 6 February 9th 05 02:15 PM


All times are GMT +1. The time now is 07:04 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"