Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default I want to add or subtract a range of cells

I am trying to add a range if another range is "D" or subtract if the "D" is
an "R".

I have used SUMIF to add the range but cannot figure our how to not add
those with criteria of "R" and in fact subtract them with criteria of "R".

Example: =SUMIF('Inventory Sheet'!B$9:'Inventory
Sheet'!B$10000,A9,'Inventory Sheet'!$F$9:'Inventory Sheet'!$F$9999)

Any suggestions would be appreciated.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default I want to add or subtract a range of cells

With A1 thru B9 containing:

1 d
2 d
3 d
4 d
5 r
6 r
7 r
8 d
9 d


=SUMPRODUCT(--(B1:B10="d"),A1:A10)-SUMPRODUCT(--(B1:B10="r"),A1:A10)

will yield 9
--
Gary''s Student - gsnu201003


"wormburner" wrote:

I am trying to add a range if another range is "D" or subtract if the "D" is
an "R".

I have used SUMIF to add the range but cannot figure our how to not add
those with criteria of "R" and in fact subtract them with criteria of "R".

Example: =SUMIF('Inventory Sheet'!B$9:'Inventory
Sheet'!B$10000,A9,'Inventory Sheet'!$F$9:'Inventory Sheet'!$F$9999)

Any suggestions would be appreciated.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default I want to add or subtract a range of cells

Maybe this...

=SUM(SUMIF('Inventory Sheet'!B$9:B$10000,{"D","R"},'Inventory
Sheet'!$F$9:$F$9999)*{1,-1})


--
Biff
Microsoft Excel MVP


"wormburner" wrote in message
...
I am trying to add a range if another range is "D" or subtract if the "D"
is
an "R".

I have used SUMIF to add the range but cannot figure our how to not add
those with criteria of "R" and in fact subtract them with criteria of "R".

Example: =SUMIF('Inventory Sheet'!B$9:'Inventory
Sheet'!B$10000,A9,'Inventory Sheet'!$F$9:'Inventory Sheet'!$F$9999)

Any suggestions would be appreciated.



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
subtract a single cell from range of cells and then count tworrall Excel Worksheet Functions 8 October 16th 09 01:45 PM
trying to subtract a range from a cell Angel Woman Excel Worksheet Functions 1 March 26th 09 08:26 PM
subtract a range from an added range Marge Excel Discussion (Misc queries) 2 November 20th 08 10:09 PM
I need to subtract a range of numbers natashac Excel Worksheet Functions 5 October 2nd 07 01:32 AM
Subtract Range Of Numbers using a Formula Josh Davis Excel Discussion (Misc queries) 1 June 21st 06 04:05 AM


All times are GMT +1. The time now is 11:25 AM.

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"