how to sum a text field with commas

I have a field that contains values like "1,3,0,0" and "2,0,0" and "1".  I
need to sum those values within the field.  The field can have up to 100
numbers seperated by commas.  How can I do sum them?

so in example 1  "1,3,0,0" I would want it to say 4
example 2  "2,0,0" I would want it to say 2
example 3  "1" I would want it to say 1

Any help is much appreciated.  Thanks!

0
RedGlow06
12/22/2009 7:06:42 PM
sqlserver.programming 1873 articles. 0 followers. Follow

10 Replies
846 Views

Similar Articles

[PageSpeed] 54

RedGlow06 wrote:
> I have a field that contains values like "1,3,0,0" and "2,0,0" and
> "1".  I need to sum those values within the field.  The field can
> have up to 100 numbers seperated by commas.  How can I do sum them?
>
> so in example 1  "1,3,0,0" I would want it to say 4
> example 2  "2,0,0" I would want it to say 2
> example 3  "1" I would want it to say 1
>
> Any help is much appreciated.  Thanks!

Given the creation of a table called Numbers:
********************************************************************
CREATE TABLE dbo.Numbers
(
    Number INT IDENTITY(1,1) PRIMARY KEY CLUSTERED
)

WHILE COALESCE(SCOPE_IDENTITY(), 0) <= 1024
BEGIN
    INSERT dbo.Numbers DEFAULT VALUES
END
********************************************************************

This will do what you want:
select 1 as ID,'1,3,0,0' as vals into #tmp
union select 2,'2,0,0'
union select 3,'1'

select id, vals,sum(number) as total
from (
    select id,vals,Number
    from #tmp as t , numbers as n
        WHERE CHARINDEX
        (
            ','+CONVERT(VARCHAR(12),Number)+',',
            ','+vals+','
        ) > 0
) as q
group by id,vals


Now you can read the rest of the answers which will undoubtedly start by
castigating the designer of this database for storing multiple pieces of
data in a single column, thus violating normal form and causing the
problem you are now experiencing.

-- 
HTH,
Bob Barrows


0
Bob
12/22/2009 7:43:33 PM
It looks to be working ok except when I have 2 of the same values like "1,1,
0" shows up as 1 or "1,2,1,0" shows up as 3.  Any suggestions?

Bob Barrows wrote:
>> I have a field that contains values like "1,3,0,0" and "2,0,0" and
>> "1".  I need to sum those values within the field.  The field can
>[quoted text clipped - 5 lines]
>>
>> Any help is much appreciated.  Thanks!
>
>Given the creation of a table called Numbers:
>********************************************************************
>CREATE TABLE dbo.Numbers
>(
>    Number INT IDENTITY(1,1) PRIMARY KEY CLUSTERED
>)
>
>WHILE COALESCE(SCOPE_IDENTITY(), 0) <= 1024
>BEGIN
>    INSERT dbo.Numbers DEFAULT VALUES
>END
>********************************************************************
>
>This will do what you want:
>select 1 as ID,'1,3,0,0' as vals into #tmp
>union select 2,'2,0,0'
>union select 3,'1'
>
>select id, vals,sum(number) as total
>from (
>    select id,vals,Number
>    from #tmp as t , numbers as n
>        WHERE CHARINDEX
>        (
>            ','+CONVERT(VARCHAR(12),Number)+',',
>            ','+vals+','
>        ) > 0
>) as q
>group by id,vals
>
>Now you can read the rest of the answers which will undoubtedly start by
>castigating the designer of this database for storing multiple pieces of
>data in a single column, thus violating normal form and causing the
>problem you are now experiencing.
>

0
RedGlow06
12/22/2009 8:38:48 PM
1. Shoot the database designer ;-)
2. Discard using the Numbers table approach. You will need a function
for this. Unfortunately, I don't have time to write one right now. If no
one posts an answer, you can find one yourself by googling

SQL parse comma delimited string


RedGlow06 wrote:
> It looks to be working ok except when I have 2 of the same values
> like "1,1, 0" shows up as 1 or "1,2,1,0" shows up as 3.  Any
> suggestions?
>
> Bob Barrows wrote:
>>> I have a field that contains values like "1,3,0,0" and "2,0,0" and
>>> "1".  I need to sum those values within the field.  The field can
>> [quoted text clipped - 5 lines]
>>>
>>> Any help is much appreciated.  Thanks!
>>
>> Given the creation of a table called Numbers:
>> ********************************************************************
>> CREATE TABLE dbo.Numbers
>> (
>>    Number INT IDENTITY(1,1) PRIMARY KEY CLUSTERED
>> )
>>
>> WHILE COALESCE(SCOPE_IDENTITY(), 0) <= 1024
>> BEGIN
>>    INSERT dbo.Numbers DEFAULT VALUES
>> END
>> ********************************************************************
>>
>> This will do what you want:
>> select 1 as ID,'1,3,0,0' as vals into #tmp
>> union select 2,'2,0,0'
>> union select 3,'1'
>>
>> select id, vals,sum(number) as total
>> from (
>>    select id,vals,Number
>>    from #tmp as t , numbers as n
>>        WHERE CHARINDEX
>>        (
>>            ','+CONVERT(VARCHAR(12),Number)+',',
>>            ','+vals+','
>>        ) > 0
>> ) as q
>> group by id,vals
>>
>> Now you can read the rest of the answers which will undoubtedly
>> start by castigating the designer of this database for storing
>> multiple pieces of data in a single column, thus violating normal
>> form and causing the problem you are now experiencing.

-- 
HTH,
Bob Barrows


0
Bob
12/22/2009 9:00:30 PM
OK, here's one way to skin this cat:

create function dbo.SumDelimited (
@vals varchar(2000)
)
RETURNS int
AS
BEGIN
declare @retval int, @val int
declare @pos int

set @vals=@vals + ','
set @retval=0
while patindex('%,%',@vals) <> 0
begin
 set @pos=patindex('%,%',@vals)
 set @val=left(@vals,@pos-1)
 set @retval=@retval + @val
 set @vals=stuff(@vals,1,@pos,'')
end

RETURN @retval
END

select 1 as ID,'1,3,1,0' as vals into #tmp
union select 2,'2,20,0'
union select 3,'1'

select id,vals,dbo.SumDelimited(vals) Total
from #tmp

Of course, you will need  to add some validation and error-handling code
in there just in case someone screws up and enters invalid data (which
is another one of the pitfalls of using a non-normalized database design
.... *)


*If you're not getting the impression that I disapprove of this table's
design, you're not reading closely enough :-)

RedGlow06 wrote:
> It looks to be working ok except when I have 2 of the same values
> like "1,1, 0" shows up as 1 or "1,2,1,0" shows up as 3.  Any
> suggestions?
>
> Bob Barrows wrote:
>>> I have a field that contains values like "1,3,0,0" and "2,0,0" and
>>> "1".  I need to sum those values within the field.  The field can
>> [quoted text clipped - 5 lines]
>>>
>>> Any help is much appreciated.  Thanks!
>>
>> Given the creation of a table called Numbers:
>> ********************************************************************
>> CREATE TABLE dbo.Numbers
>> (
>>    Number INT IDENTITY(1,1) PRIMARY KEY CLUSTERED
>> )
>>
>> WHILE COALESCE(SCOPE_IDENTITY(), 0) <= 1024
>> BEGIN
>>    INSERT dbo.Numbers DEFAULT VALUES
>> END
>> ********************************************************************
>>
>> This will do what you want:
>> select 1 as ID,'1,3,0,0' as vals into #tmp
>> union select 2,'2,0,0'
>> union select 3,'1'
>>
>> select id, vals,sum(number) as total
>> from (
>>    select id,vals,Number
>>    from #tmp as t , numbers as n
>>        WHERE CHARINDEX
>>        (
>>            ','+CONVERT(VARCHAR(12),Number)+',',
>>            ','+vals+','
>>        ) > 0
>> ) as q
>> group by id,vals
>>
>> Now you can read the rest of the answers which will undoubtedly
>> start by castigating the designer of this database for storing
>> multiple pieces of data in a single column, thus violating normal
>> form and causing the problem you are now experiencing.

-- 
HTH,
Bob Barrows


0
Bob
12/22/2009 10:15:15 PM
RedGlow06 (u57010@uwe) writes:
> I have a field that contains values like "1,3,0,0" and "2,0,0" and "1".  I
> need to sum those values within the field.  The field can have up to 100
> numbers seperated by commas.  How can I do sum them?
> 
> so in example 1  "1,3,0,0" I would want it to say 4
> example 2  "2,0,0" I would want it to say 2
> example 3  "1" I would want it to say 1
> 
> Any help is much appreciated.  Thanks!
 
Look here for a number of methods:
http://www.sommarskog.se/arrays-in-sql.html


-- 
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

0
Erland
12/22/2009 11:14:53 PM
There is a massive forum thread on sqlservercentral on string parsing, 
complete with countless solutions to the problem and a dizzying array of 
benchmarks.

-- 
Kevin G. Boles
Indicium Resources, Inc.
SQL Server MVP
kgboles a earthlink dt net


"RedGlow06" <u57010@uwe> wrote in message news:a0fc0f89c2b74@uwe...
> It looks to be working ok except when I have 2 of the same values like 
> "1,1,
> 0" shows up as 1 or "1,2,1,0" shows up as 3.  Any suggestions?
>
> Bob Barrows wrote:
>>> I have a field that contains values like "1,3,0,0" and "2,0,0" and
>>> "1".  I need to sum those values within the field.  The field can
>>[quoted text clipped - 5 lines]
>>>
>>> Any help is much appreciated.  Thanks!
>>
>>Given the creation of a table called Numbers:
>>********************************************************************
>>CREATE TABLE dbo.Numbers
>>(
>>    Number INT IDENTITY(1,1) PRIMARY KEY CLUSTERED
>>)
>>
>>WHILE COALESCE(SCOPE_IDENTITY(), 0) <= 1024
>>BEGIN
>>    INSERT dbo.Numbers DEFAULT VALUES
>>END
>>********************************************************************
>>
>>This will do what you want:
>>select 1 as ID,'1,3,0,0' as vals into #tmp
>>union select 2,'2,0,0'
>>union select 3,'1'
>>
>>select id, vals,sum(number) as total
>>from (
>>    select id,vals,Number
>>    from #tmp as t , numbers as n
>>        WHERE CHARINDEX
>>        (
>>            ','+CONVERT(VARCHAR(12),Number)+',',
>>            ','+vals+','
>>        ) > 0
>>) as q
>>group by id,vals
>>
>>Now you can read the rest of the answers which will undoubtedly start by
>>castigating the designer of this database for storing multiple pieces of
>>data in a single column, thus violating normal form and causing the
>>problem you are now experiencing.
>>
> 


0
TheSQLGuru
12/23/2009 7:29:45 PM
>>  I have a field [sic: columns are not fields] that contains values like =
"1,3,0,0" and "2,0,0" and "1". =A0I need to sum those values within the fie=
ld [sic]. =A0The field [sic] can have up to 100 numbers separated by commas=
.. =A0How can I do sum them? <<

BY DEFINITION a column has scalar values, this is not a valid value in
SQL.  This violates a thing called First Normal Form (1NF) which you
will find in the first few chapters of a book on RDBMS.

You can find lots of stinking kludges to parse strings, but the right
answer is to design a proper schema and fire the guy who did this.

If you use a kludge, be sure to include code to raise all the errors
that a parameter in a procedure call can raise.  The cowboy coders
never bother with that part ..
0
CELKO
12/23/2009 8:50:28 PM
> BY DEFINITION a column has scalar values, this is not a valid value in
> SQL.  This violates a thing called First Normal Form (1NF) which you

I think you are confusing the query language (SQL, or in this product TSQL) 
with database design.

In database design yes, you would eradicate this type of structure.

SQL is querying - nothing more.

You also show a sheltered existence, really, have you never had to chop and 
refine data - would you honestly write a separate one off program in C when 
in a fraction of the time you could cut and massage the data into a 
structure you want and conforms to proper database design principles?

--ROGGIE-- 

"--CELKO--" <jcelko212@earthlink.net> wrote in message 
news:6ab35ce4-1acc-48cb-8c6e-08bb960ccc6a@c34g2000yqn.googlegroups.com...
>>>  I have a field [sic: columns are not fields] that contains values like 
>>> "1,3,0,0" and "2,0,0" and "1".  I need to sum those values within the 
>>> field [sic].  The field [sic] can have up to 100 numbers separated by 
>>> commas.  How can I do sum them? <<
>
> BY DEFINITION a column has scalar values, this is not a valid value in
> SQL.  This violates a thing called First Normal Form (1NF) which you
> will find in the first few chapters of a book on RDBMS.
>
> You can find lots of stinking kludges to parse strings, but the right
> answer is to design a proper schema and fire the guy who did this.
>
> If you use a kludge, be sure to include code to raise all the errors
> that a parameter in a procedure call can raise.  The cowboy coders
> never bother with that part .. 

0
Tony
12/23/2009 9:22:37 PM
>> SQL is querying - nothing more. <<

Actually it is DDL, DML, DCL and transaction control.  This is one of
the major problems that cowboy coders have; they think SQL =3D DML, and
fail to create integrated systems.

>> You also show a sheltered existence, really, have you never had to chop =
and refine data - would you honestly write a separate one off program in C =
when in a fraction of the time you could cut and massage the data into a st=
ructure you want and conforms to proper database design principles? <<

LOL!  These days, I use a word processor or a spreadsheet most of the
time!  I find that most one-shot jobs have the data I want on a
website for download.  Most of the cleanup work is with text --
squeeze spaces, change case, run a macro and stick it into a CSV file
for BCP or some INSERT INTO statements.

For repeated jobs, we usually have an ETL tool in my "sheltered
existence" IT shops.

0
CELKO
12/23/2009 11:15:49 PM
> Actually it is DDL, DML, DCL and transaction control.  This is one of
> the major problems that cowboy coders have; they think SQL = DML, and
> fail to create integrated systems.
>

You said this...

"BY DEFINITION a column has scalar values, this is not a valid value in SQL"

Holding "1,2,3" in a column has nothing to do with DDL, DML, DCL, {querying} 
and transaction control.

IT has everything to do with database design 1nf, 2nf etc...

> LOL!  These days, I use a word processor or a spreadsheet most of the
> time!  I find that most one-shot jobs

Next time (later this morning) I need to bring in a 20MByte file with a 
couple of million rows in it and validate it, and then insert it into my 
database I'll be sure to try and do that with Word or Excel.

Right tool for the right job; often SSIS is over kill and takes longer for 
what you are trying to do; a lot of the time its easier, more maintainable, 
more cost effective to load the data into temporary tables within the 
database and use "T-SQL" to validate etc...

But, you'd not know that if you worked just with theory; its only by 
actually doing stuff you'd get to know this "experience".


> For repeated jobs, we usually have an ETL tool in my "sheltered
> existence" IT shops.
>

Cool - so, a lot of experience on a day to day basis doing that? Or is it, 
as I suspect; something you've only occasionally done
..
Perhaps one of these days I'll bring a lap top with some of the products you 
say you have used and put it in front of you and say "go on then, should me 
the basics of the product" - I've no doubt in my mind you'd be clueless.

--ROGGIE--

"--CELKO--" <jcelko212@earthlink.net> wrote in message 
news:01905906-cbad-451f-a5a4-383330258424@j24g2000yqa.googlegroups.com...
>>> SQL is querying - nothing more. <<
>
> Actually it is DDL, DML, DCL and transaction control.  This is one of
> the major problems that cowboy coders have; they think SQL = DML, and
> fail to create integrated systems.
>
>>> You also show a sheltered existence, really, have you never had to chop 
>>> and refine data - would you honestly write a separate one off program in 
>>> C when in a fraction of the time you could cut and massage the data into 
>>> a structure you want and conforms to proper database design principles? 
>>> <<
>
> LOL!  These days, I use a word processor or a spreadsheet most of the
> time!  I find that most one-shot jobs have the data I want on a
> website for download.  Most of the cleanup work is with text --
> squeeze spaces, change case, run a macro and stick it into a CSV file
> for BCP or some INSERT INTO statements.
>
> For repeated jobs, we usually have an ETL tool in my "sheltered
> existence" IT shops.
> 
0
Tony
12/24/2009 6:23:38 AM
Reply:

Similar Artilces:

How to perform sum sum sum...
How to perform sumation within that particular item but the item is not unique...means item 1 has its own quantity and same goes to item 2...but in the same table... -- Message posted via http://www.accessmonster.com On Tue, 17 Apr 2007 05:28:12 GMT, "EMILYTAN via AccessMonster.com" <u33296@uwe> wrote: >How to perform sumation within that particular item but the item is not >unique...means item 1 has its own quantity and same goes to item 2...but in >the same table... Group By the item. For a more detailed answer, please post a more detailed question (with a des...

Hyperlink field that does not link to the file
I have a hyperlink field called FileName in Access, to populate this field I imported from Excel the list of file names such as “\\MAIN-SERVER\DOWN-SERVER\Documents 001.doc," "... Documents 002.doc“ and many more after the import succeeded then I clicked the hyperlink field to open the file, but it won't open the file. As you know Excel 2007 does not support hyperlink type, so the cell type in Excel was Text. So I copied the file name from the Access field to a Word document, Ctrl-click does not open it. To make the link work in Word I put the cursor to the en...

Click to Open Record from an Unbound Text Box
Hi All, Getting close I think. I have an unbound text box on a subform that lists items from a table (tblSENEIncidentLog2008). The subform is on my Main Form. I am trying to make it so when I click on an item from my ListBox, it loads the form and goes to that record. Right now, when I click on an item on the subform FROM MY MAIN MENU, it opens the form, but it only goes to the FIRST record of the form and shows Filtered. When I click on it with JUST the subform open, it seems to work fine. This is what I have in my List box (ListSAR) on the subform: In the After Update: Private S...

Summing up user defined results
Hi all - I'm new to VBA programming in Excel and so any help i'd totally love! I'm currently writing a function. Objective: user can select rows (do not have to be sequential). User clicks on button. UserForm appears with summed results from ONLY rows that he selected. What I have now, well it doesn't work: Sub Button6_Click() Dim i As Integer Dim totalNumbers As Integer Dim aRange As range For Each a In Selection.Areas 'MsgBox "Area " & i & " of the selection contains " & _ ' a.Rows.Count & " rows." &...

Pasting unformatted text
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) I cannot find an 'Edit > Paste Special... > Unformatted Text' command to assign to a keyboard shortcut. Can you help please? <br><br>I have no idea how to use AppleScript or Automator. <br><br>fh Nope, not an option. The script you need is freely available though. See this page for how to take advantage of it, then click the last link on that page to retrieve the script; http://word.mvps.org/mac/Scripts/index.html HTH |:>) Bob Jones [MVP] Office:Mac On 1/28/10 6:28 AM,...

Multiple variables to sort and sum, return values<0 with sum refer
Can anyone help me with this one please? I have this table of data. I'd like to be able to write a formula(s) which sums the No according to date and code, but then only returns a sum value (with the code and date in the two adjacent cells) if there is a value greater than 0. Code Ref No Date 1 G/032/05/999 400600 212 19/03/2010 2 G/032/03/001/999 400500 50 19/03/2010 3 G/032/02/001/001 400400 170 19/03/2010 4 G/032/05/999 400600 315 19/03/2010 5 G/032/03/001/999 400500 300 19/03/2010 6 G/032/05/999 400600 202 19/03/2010 7 G/032/03/001/002 40...

why does my signiture text change color when I reply
When I reply it a post that originally came from me - my signiture text changes colour to very light yellow. How do I stop this? ...

Menus & Windows vs Forms in Field Level Security
We have GP9.0. What is the difference between a "window" and a "form" in Field Level Security? I am trying to make it so that all users have to enter a password before they can access any of the windows/forms under Tools>>Routines>>Financial, but I'm not sure if I should select each of the forms or each of the windows in the Resource Explorer. Also, is there an easier way to set field security for an entire menu like this? I know in GP7.5 we had the field level security set on the palette, but I don't see any way of doing this for a menu. Keep in ...

sum subform to form
=Sum([Forms]![frmCamPledgeList].[frmCamPledgeListSub].[Amount Pledged]) Form (frmCamPledgeList) with subform frmCamPledgeListSub). Subform has a field named Pledge Amount. I want to put a field on the form that gives me a total of the subform's Amount Pledged. I have tried the above, but I get an #error in the unbound text box. Do you need any more info? Any thoughts on why this does not work? Thanks in advance, Scott -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access-forms/200912/1 The proper syntax is =Sum([Forms]![frmCa...

text wrap problem
I have a problem with wrapping text around a clip art picture. Sometimes it works, sometimes it doesn't! I used the same text and the same picture to test it out. I've just got it to work, but I need to know if this is a bug because I'm writing a text book. Any help would be appreciated. Cheers. Sorry, forgot to mention I'm using 2003. >-----Original Message----- >I have a problem with wrapping text around a clip art >picture. Sometimes it works, sometimes it doesn't! I >used the same text and the same picture to test it out. >I've just g...

How do I select all (text) of an email in Outlook 2007? (other th.
How do I select all (text) of an email in Outlook 2007? (other then Ctrl+A) I was unable to find the option/button and Select All does not appear during right-click. > How do I select all (text) of an email in Outlook 2007? (other then > Ctrl+A) > I was unable to find the option/button and Select All does not appear > during right-click. With the message open: Message tab, in the Find section Select, Select All Without the message open (ie, in the reading pane): Click at the beginning of the message, hold down the button and drag to the bottom of the message. Looks like there...

Opening files automatically with Import Text File dialog box
I would like to eliminate the requirement to have a user click on the Import button during VBA control of the Import Text File dialog box. This will facilitate the automatic processing of sequentially numbered files. I would appreciate any suggestions. Here's a simplified listing of the code I'm using. Sub ImportOrigData() ' ActiveWindow.ScrollWorkbookTabs Position:=xlFirst Sheets("OrigDataFile").Select Range("A10").Select Dim sText As String For DOY = 147 To 149 ' first and last day of year to be processed sText...

forwarded message come in as .eml, not inline Text Outlook 2003
When people forward messages to me, the forwarded message arrives as an .eml attachment. I am using Outlook 2003. How can I get the system to not convert the forwarded messages as .eml attachments, rather in-line text in the e-mail? Thanks, Leslie They've probably chose to forward as attachment and are using Outlook Express or Windows (Live) Mail. Have them use a normal forward instead. -- Robert Sparnaaij [MVP-Outlook] Coauthor, Configuring Microsoft Outlook 2003 http://www.howto-outlook.com/ Outlook FAQ, HowTo, Downloads, Add-Ins and more http://www.msoutlook.info/ Real World...

Calculate sum of a field within the query
I have a query that returns the details for a failure record during a specified time period. Where if I search between 1/1/08 and 1/31/08 the query returns the records of all failure records during that period. The row shows the part number and the total parts failed for that record. I need the query to then sum the total part failures for the previous 12 months. So I would see the following: Record # | part # | parts failed | Origination Date| Total Parts failed past 12 months 44444 | x | 4 | 1/2/08 | 200 44445 | Y |1 ...

Allow Excel to orient/align text 180 degrees
Is this possible? Are you sure you mean 180 degrees? This would leave the text upsidedown and backwards which cannot be done unless you take a picture of the tert and rotate it. Do you perhaps mean "reverse the order of the text from front to back" which would leave it rightside up with letters reversed? That can be done with a User Defined Function. Public Function RevStr(Rng As Range) RevStr = StrReverse(Rng.text) End Function Gord Dibben Excel MVP On Thu, 6 Jan 2005 13:11:06 -0800, "QuadJoe4x4" <QuadJoe4x4@discussions.microsoft.com> wrote: >Is t...

Calculating a percentage from values in two different fields
Hi, I have a query called SalesBudget3 that has fields which include: CustomerName, Type and then all of the months of the year (January, February). The type field is either Actual or Budget. My query will return two records per client. The first would have their actual sales for 2008 and the second would have their budgeted sales. In my report, I have the field names in the page header (Type, January etc) and CustomerName in the CustomerName header. The Details sections has their monthly sales figures. In the CustomerName footer, I want to calculate percent of Actual to Budget pe...

how to make this work if sum=5+n2 then sum becomes the value of s.
I want to get or create a formula in excel or access that allows me to keep a running total of my supplies ie... I have 2 pens, remove one and receive 2. answer in the cell becomes 3 pens then if I zero out the received cell the inventory cell still remembers that I have 3 pens not 4 pens (because I received 2 more pens) and visa versa when I zero out the received cell it remembers I have 3 pens not 1 pen(because I removed 1 pen) I believe the method you suggest is flawed. You have no audit trail. If the number on the sheet doesn't match your actual inventory, how will you figure out...

=SUM Ranges Do Not Update
I have a Excel 2000 spread sheet, with the following macro to insert new row. Sub InsertRow() ' ' Macro1 Macro ' Macro recorded 4/27/2004 ' 'GoTo label, MyString ActiveSheet.Unprotect Application.Goto Reference:="MyCell" ActiveCell.Select ActiveCell.EntireRow.Insert ActiveCell.Offset(-1, 0).Select ActiveCell.EntireRow.Copy ActiveCell.Offset(1, 0).Select ActiveCell.PasteSpecial xlPasteAll Application.CutCopyMode = False ActiveCell.Select ActiveSheet.Protect DrawingObjects:=True, Contents:=True Scenarios:=True End Sub The problem is that in the "Mycell&qu...

Sum value between dates problem driving me mad!
Good Evening All, I am really struggling here, have tried, nested IF's including AND's but am a bit stumped. I am fairly familiar with Arrays, but cannot seem to combine all. I have a data table (as detailed below). (Hopefully, this should be 'pastable' into Excel - it works for me) I simply wish to calculate the expected totals per month. Any help & assistance with this would be most welcome. Cheers, Mathew Note, earliest Start is 01/04/03 Start Finish Day Rate Apr-2003 May-2003 Jun-2003 Jul-2003 Aug-2003 01/04/2003 23.00 01/04/2003 09/07/2003 23.00 ...

Conditional Sum Wizard
Currently I am setting up a sheet and I am using the conditional sum wizard for formulas. Once a formula is created the sytem won't let me copy or change a formula. If I try to copy (Copy, paste special) a formula to another cell, the formula won't work anymore. If I create a formula with the wizard and afterwards change one of the parameters, the formula does not work anymore. Can anyone give me a hint on how I can solve these issues? Thanks. Please don't multi-post - you have an answer elsewhere, relating to use of CSE. Pete On Jan 6, 9:23=A0am, MarcoKoenders <MarcoKo...

Sum Question
I am using Excel 2000 I have the following very simple formula in column j Sheet1 =SUM(B5*H5) I have this copied all the way down to line 40. It shows 0 in all of the cells all the way down. I would like for there to be a way that the cell would not show anything in it UNLESS there was something that it was calculating. For example. I have entered data in column b and column h through line 10, but it still shows 0 in column J all the way down to line 40. I realize that it is showing these 0's b/c I have placed the formula there, but is there a way that it will still calculate but only ...

How is the 'FROM' field supposed to work in 2003?
I've noticed in inconsistent behavior of how the FROM field works when sending messages in Outlook 2003. From my testing it seems like on some occasions it will look as if the message has actually come from the name I enter into the field. I.e. 'John Smith' however on other occasions it will say sent from 'Myself' on behalf of 'John Smith'. Can someone confirm how it is supposed to work in an IMAP environment? Thank you. On Thu, 16 Dec 2004 00:46:07 -0000, Maz wrote: > I've noticed in inconsistent behavior of how the FROM field works when > se...

how do i put text on the y axis. Can I even?
All I want to do is put text in the Y axis area. Aja Mehki wrote: > All I want to do is put text in the Y axis area. http://www.geocities.com/jonpeltier/Excel/Charts/axes.html#ArbAxis http://www.geocities.com/jonpeltier/Excel/Charts/DummySeries.html#VertCatAxi s (copy and paste text into your browser if word wrap cuts off the URL) Dave dvt at psu dot edu ...

Using Word 2007 to edit text in Publisher 2007
I have recently bought a new computer with Windows 7 Pro (64bit) installed and now have a problem when editing text from Publisher 2007 in Word 2007. I produce our local church magazine where the main body of the text is Gill Sans 11pt. If I now right click the main body choose Change Text, Edit Story in MS Word, after editing and returning to Publisher all the 11pt text is now 10pt and I have to reformat it all again (this time in Publisher!). Previously I have been using Windows XP Pro with no such problems, so I think it may be a Win 7 problem. Has anyone else had a similar pro...

Outlook Organization fields #2
Is there a default setting in outlook 2000 that can determine which organization fields are showing when you create a new directory? What I mean by "field" is the way you can organize the emails. From, To, Subject, Date Received, Sent, etc. For some reason my "From" box is missing from each new directory I create. Having to go into "Customize Current View" and create it again is going to become more and more irritating as time goes by. Does anyone know something about this? ...