Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 29
Default is there a formula to add numbers in a range based on several crit

im trying to add the quantities in one column based on if the dates in the
corresponding cells in another column occured within the past week
ive tried a nested sumif formula and a dsum but neither work very well
thank you,
barry
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default is there a formula to add numbers in a range based on severalcrit

Suppose you have dates in column A and quantities in column B in rows
2 to 50. Then you can try this formula in D1:

=SUMIF(A$2:A$50,"<="&TODAY(),B$2:B$50) - SUMIF(A$2:A$50,"<"&TODAY()-7,B
$2:B$50)

if you want it to compare with today's date. However, this will change
when you open the file on a different day, so you might like to put a
reference date in C1 (which could be =TODAY() ), and then make the
formula:

=SUMIF(A$2:A$50,"<="&C1,B$2:B$50) - SUMIF(A$2:A$50,"<"&C1-7,B$2:B$50)

Hope this helps.

Pete

On Mar 24, 11:59*pm, BROCK8292
wrote:
im trying to add the quantities in one column based on if the dates in the
corresponding cells in another column occured within the past week
ive tried a nested sumif formula and a dsum but neither work very well
thank you,
barry


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default is there a formula to add numbers in a range based on severalcrit

Hi Barry,

here's another way (same set up as before, with reference date in C1
and formula in D1):

=SUMPRODUCT((A$2:A$50<=C1)*(A$2:A$50C1-7)*(B$2:B$50))

Hope this helps.

Pete

On Mar 24, 11:59*pm, BROCK8292
wrote:
im trying to add the quantities in one column based on if the dates in the
corresponding cells in another column occured within the past week
ive tried a nested sumif formula and a dsum but neither work very well
thank you,
barry


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
Range Penetration - formula based on percentage Danielle Excel Discussion (Misc queries) 7 May 20th 23 07:41 PM
Macro to insert a formula based on a range MarcusA Excel Discussion (Misc queries) 1 December 8th 06 09:26 AM
Count the number of rows where more than one column meets set crit BarrieVoice Excel Worksheet Functions 2 July 14th 06 07:25 PM
Pull information based on a range of numbers Styckz Excel Worksheet Functions 0 April 17th 06 08:31 AM
overtime formula based on dynamic date range? kalika Excel Worksheet Functions 2 August 28th 05 08:40 AM


All times are GMT +1. The time now is 11:20 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"