Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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! |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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! |
#5
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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! |
#6
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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! |
#7
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Pasting Numbers with Commas from Outside Source | Excel Discussion (Misc queries) | |||
find and replace - replace data in rows to separated by commas | Excel Worksheet Functions | |||
Count comma separated numbers, numbers in a range with dash, not t | Excel Discussion (Misc queries) | |||
how to count occurence of numbers separated by , in a single cell | Excel Worksheet Functions | |||
many numbers in one cell separated by hyphen. | Excel Discussion (Misc queries) |