Sum based on condtions in another worksheet

wpryan

Well-known Member
Joined
May 26, 2009
Messages
534
Office Version
  1. 365
Platform
  1. Windows
Hi All, I am working a staffing calculator that will project staffing needs based on various criteria. One of them will be to sum days worked for conferences. The user should enter a date range of the conference and a formula will sum those days - this is easy enough. However, what I want to do is to create a formula that will look for a date range within the cells, and then sum those total days for that date range. For example, rows 2 and 5 are within the date range of March. The rest are not. How can I get the formula to sum only the cells for the date range in question? Will I have to use VBA? I tried working with the following formula, but obviously it will sum all days... Thanks in advance.
Code:
=IF(ISBLANK('2010 Conferences'!B:C),"",IF(OR('2010 Conferences'!B:B>1/7/2011,'2010 Conferences'!B:B<31/7/2011),SUM('2010 Conferences'!E:E),""))
 
Last edited:

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Try

=SUMPRODUCT(--('2010 Conferences'!B1:B100>="1/7/2011"+0),--('2010 Conferences'!B1:B100<="31/7/2011"+0),'2010 Conferences'!E1:E100)
 
Upvote 0
Thanks for your reply. it works great. Can you explain to me what the "--" means in the equation?
 
Upvote 0
('2010 Conferences'!B1:B100>="1/7/2011"+0 returns an array of False/True. The -- operator converts those to 0/1 that SUMPRODUCT can work with.
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,286
Members
452,902
Latest member
Knuddeluff

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top