The Code Cage - Microsoft Office help Free Microsoft Office Help for all Applications!
In home Tech Support
Satellite Television
 

To stop seeing these ads and get other benefits check This page!

Go Back   The Code Cage Forums > Newsgroups - Microsoft Topics > Newsgroup - Excel Forum > Worksheet Functions

Custom Search
Translate this Page!
Chat In Use Now! Microsoft Office Chat Online now!


Worksheet Functions Post questions in this forum if they are related to using Microsoft Excel Worksheet Functions, e.g Forumale or built in functionality etc.

Hey there!

It looks like you're enjoying but haven't created an account yet. Why not take a minute to register for your own free account now? As a member you get free access to all of our forums and posts plus the ability to post your own messages, communicate directly with other members and much more. Register now!

Already a member? Login at the top of this page to stop seeing this message.


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11th March 2010, 09:13 PM
Ann Scharpf
Newsgroup Contributor


My Top Tip Count:

 
Posts: n/a
Chats:
Default SUMIF() to add cells in non-contiguous ranges? (Excel 2003)

------ Register to get rid of these "In Post" ads! ------


I have a bunch of columns with dollar values. I want to add the sum of all
the values for rows that meet a single condition. If possible, I'd like to
create a named a range that includes all the non-contiguous dollar value
columns and use a single SUMIF(). In my test, I named this range DOLLARS.

The formula =SUM(DOLLARS) does work fine and adds up ALL the values.

To test the SUMIF(), I set up a column (named range "decision") with yes/no
values. I get a #VALUE error when I try the formula
=SUMIF(decision,"=yes",dollars).

I looked at some of the posts for array functions and I can't really tell if
an array formula would fix this problem. Is this possible to do as a single
function, or do I have to have something like this:

=SUMIF(decision,"=yes",dollars1)+SUMIF(decision,"=yes",dollars2)...

Thanks for your help.
--
Ann Scharpf
Reply to this post


Did you find this post helpful? Yes | No

The Code Cage Advertisment
Advertisement

To stop seeing these ads and get other benefits check This page!
  #2 (permalink)  
Old 11th March 2010, 10:17 PM
T. Valko
Newsgroup Contributor


My Top Tip Count:

 
Posts: n/a
Chats:
Default Re: SUMIF() to add cells in non-contiguous ranges? (Excel 2003)

------ Register to get rid of these "In Post" ads! ------


>In my test, I named this range DOLLARS.

What are the individual range addresses that make up DOLLARS?

>I set up a column (named range "decision") with yes/no


What is the range address that makes up DECISION?

--
Biff
Microsoft Excel MVP


"Ann Scharpf" <AnnScharpf@discussions.microsoft.com> wrote in message
news:30B2910B-5948-49E9-BDE8-4AE107514FE6@microsoft.com...
>I have a bunch of columns with dollar values. I want to add the sum of all
> the values for rows that meet a single condition. If possible, I'd like
> to
> create a named a range that includes all the non-contiguous dollar value
> columns and use a single SUMIF(). In my test, I named this range DOLLARS.
>
> The formula =SUM(DOLLARS) does work fine and adds up ALL the values.
>
> To test the SUMIF(), I set up a column (named range "decision") with
> yes/no
> values. I get a #VALUE error when I try the formula
> =SUMIF(decision,"=yes",dollars).
>
> I looked at some of the posts for array functions and I can't really tell
> if
> an array formula would fix this problem. Is this possible to do as a
> single
> function, or do I have to have something like this:
>
> =SUMIF(decision,"=yes",dollars1)+SUMIF(decision,"=yes",dollars2)...
>
> Thanks for your help.
> --
> Ann Scharpf



Reply to this post


Did you find this post helpful? Yes | No
  #3 (permalink)  
Old 12th March 2010, 02:48 PM
Ann Scharpf
Newsgroup Contributor


My Top Tip Count:

 
Posts: n/a
Chats:
Default Re: SUMIF() to add cells in non-contiguous ranges? (Excel 2003)

------ Register to get rid of these "In Post" ads! ------


Well, my dummy test and the real document are set up differently.

Dummy test:

Decision = D4:D18
Dollars = E4:E18, G4:G18, I4:I18

Real document:

Customer Funding Category:
F:F

Material Costs:
I:I, M:M
--
Ann Scharpf


"T. Valko" wrote:

> >In my test, I named this range DOLLARS.

>
> What are the individual range addresses that make up DOLLARS?
>
> >I set up a column (named range "decision") with yes/no

>
> What is the range address that makes up DECISION?
>
> --
> Biff
> Microsoft Excel MVP
>
>
> "Ann Scharpf" <AnnScharpf@discussions.microsoft.com> wrote in message
> news:30B2910B-5948-49E9-BDE8-4AE107514FE6@microsoft.com...
> >I have a bunch of columns with dollar values. I want to add the sum of all
> > the values for rows that meet a single condition. If possible, I'd like
> > to
> > create a named a range that includes all the non-contiguous dollar value
> > columns and use a single SUMIF(). In my test, I named this range DOLLARS.
> >
> > The formula =SUM(DOLLARS) does work fine and adds up ALL the values.
> >
> > To test the SUMIF(), I set up a column (named range "decision") with
> > yes/no
> > values. I get a #VALUE error when I try the formula
> > =SUMIF(decision,"=yes",dollars).
> >
> > I looked at some of the posts for array functions and I can't really tell
> > if
> > an array formula would fix this problem. Is this possible to do as a
> > single
> > function, or do I have to have something like this:
> >
> > =SUMIF(decision,"=yes",dollars1)+SUMIF(decision,"=yes",dollars2)...
> >
> > Thanks for your help.
> > --
> > Ann Scharpf

>
>
> .
>

Reply to this post


Did you find this post helpful? Yes | No
The Code Cage Advertisment
Advertisement

To stop seeing these ads and get other benefits check This page!
  #4 (permalink)  
Old 12th March 2010, 04:08 PM
Luke M
Newsgroup Contributor


My Top Tip Count:

 
Posts: n/a
Chats:
Default Re: SUMIF() to add cells in non-contiguous ranges? (Excel 2003)

------ Register to get rid of these "In Post" ads! ------


What I think Biff was asking about was what is the logic behind the
non-contiguous cell choices?
As an quick example, this takes the sum of every 4th row that has a
corresponding text of "Add"

=SUMPRODUCT(--(NOT(MOD(ROW(A1:A20),4))),--(B1:B20="add"),(A1:A20))

Then you can get away from the use of named ranges.
--
Best Regards,

Luke M
"Ann Scharpf" <AnnScharpf@discussions.microsoft.com> wrote in message
news:DF7B0F66-AF58-4833-8A10-9313AD015A27@microsoft.com...
> Well, my dummy test and the real document are set up differently.
>
> Dummy test:
>
> Decision = D4:D18
> Dollars = E4:E18, G4:G18, I4:I18
>
> Real document:
>
> Customer Funding Category:
> F:F
>
> Material Costs:
> I:I, M:M
> --
> Ann Scharpf
>
>
> "T. Valko" wrote:
>
>> >In my test, I named this range DOLLARS.

>>
>> What are the individual range addresses that make up DOLLARS?
>>
>> >I set up a column (named range "decision") with yes/no

>>
>> What is the range address that makes up DECISION?
>>
>> --
>> Biff
>> Microsoft Excel MVP
>>
>>
>> "Ann Scharpf" <AnnScharpf@discussions.microsoft.com> wrote in message
>> news:30B2910B-5948-49E9-BDE8-4AE107514FE6@microsoft.com...
>> >I have a bunch of columns with dollar values. I want to add the sum of
>> >all
>> > the values for rows that meet a single condition. If possible, I'd
>> > like
>> > to
>> > create a named a range that includes all the non-contiguous dollar
>> > value
>> > columns and use a single SUMIF(). In my test, I named this range
>> > DOLLARS.
>> >
>> > The formula =SUM(DOLLARS) does work fine and adds up ALL the values.
>> >
>> > To test the SUMIF(), I set up a column (named range "decision") with
>> > yes/no
>> > values. I get a #VALUE error when I try the formula
>> > =SUMIF(decision,"=yes",dollars).
>> >
>> > I looked at some of the posts for array functions and I can't really
>> > tell
>> > if
>> > an array formula would fix this problem. Is this possible to do as a
>> > single
>> > function, or do I have to have something like this:
>> >
>> > =SUMIF(decision,"=yes",dollars1)+SUMIF(decision,"=yes",dollars2)...
>> >
>> > Thanks for your help.
>> > --
>> > Ann Scharpf

>>
>>
>> .
>>



Reply to this post


Did you find this post helpful? Yes | No
  #5 (permalink)  
Old 12th March 2010, 05:43 PM
T. Valko
Newsgroup Contributor


My Top Tip Count:

 
Posts: n/a
Chats:
Default Re: SUMIF() to add cells in non-contiguous ranges? (Excel 2003)

------ Register to get rid of these "In Post" ads! ------


Well, the non-contiguous range DOLLARS presents a problem.

Just because a range has a defined name doesn't mean you *have* to use that
name!

Here's how I would do it...

=SUMPRODUCT(--(Decision="yes"),E4:E18+G4:G18+I4:I18)

--
Biff
Microsoft Excel MVP


"Ann Scharpf" <AnnScharpf@discussions.microsoft.com> wrote in message
news:DF7B0F66-AF58-4833-8A10-9313AD015A27@microsoft.com...
> Well, my dummy test and the real document are set up differently.
>
> Dummy test:
>
> Decision = D4:D18
> Dollars = E4:E18, G4:G18, I4:I18
>
> Real document:
>
> Customer Funding Category:
> F:F
>
> Material Costs:
> I:I, M:M
> --
> Ann Scharpf
>
>
> "T. Valko" wrote:
>
>> >In my test, I named this range DOLLARS.

>>
>> What are the individual range addresses that make up DOLLARS?
>>
>> >I set up a column (named range "decision") with yes/no

>>
>> What is the range address that makes up DECISION?
>>
>> --
>> Biff
>> Microsoft Excel MVP
>>
>>
>> "Ann Scharpf" <AnnScharpf@discussions.microsoft.com> wrote in message
>> news:30B2910B-5948-49E9-BDE8-4AE107514FE6@microsoft.com...
>> >I have a bunch of columns with dollar values. I want to add the sum of
>> >all
>> > the values for rows that meet a single condition. If possible, I'd
>> > like
>> > to
>> > create a named a range that includes all the non-contiguous dollar
>> > value
>> > columns and use a single SUMIF(). In my test, I named this range
>> > DOLLARS.
>> >
>> > The formula =SUM(DOLLARS) does work fine and adds up ALL the values.
>> >
>> > To test the SUMIF(), I set up a column (named range "decision") with
>> > yes/no
>> > values. I get a #VALUE error when I try the formula
>> > =SUMIF(decision,"=yes",dollars).
>> >
>> > I looked at some of the posts for array functions and I can't really
>> > tell
>> > if
>> > an array formula would fix this problem. Is this possible to do as a
>> > single
>> > function, or do I have to have something like this:
>> >
>> > =SUMIF(decision,"=yes",dollars1)+SUMIF(decision,"=yes",dollars2)...
>> >
>> > Thanks for your help.
>> > --
>> > Ann Scharpf

>>
>>
>> .
>>



Reply to this post


Did you find this post helpful? Yes | No
The Code Cage Advertisment
Advertisement

To stop seeing these ads and get other benefits check This page!
Reply

Bookmarks

Tags
2003, add, cells, excel, noncontiguous, ranges, sumif


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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

Forum Jump

The Code Cage Affilliates


To stop seeing these ads and get other benefits check This page!



All times are GMT +1. The time now is 01:39 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.5.0
No part of this board may be copied or reproduced either in part or full without the express permission of The Code Cage Team.
We are not associated with nor employed by Microsoft in any way, we simply provide resources!
All MS office icons are registered trademarks of the application the represent