View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Roger Govier
 
Posts: n/a
Default Adding values for selected years

Hi David

Yes you can, but not with that syntax. You don't need AND, you just have
another set of tests.
=SUMPRODUCT(--($B$7:$B$10070)=1770),--(YEAR($E$7:$E$10070)=2006),$H$7:$H$10070)The double unary minuses -- coerce the True's to 1's and False's to 0'sso they get multiplied together along with the values in column H.So1 x 1 x 100 will = 1000 x 1 x 100 will = 01 x 0 x 100 will = 0--RegardsRoger Govier"OSDavidL" wrotein message ... Hi Roger, Many thanks this works. Can I also add an AND function into the logical test? ie=SUMPRODUCT(AND(($B$7:$B$10070)=1770,--(YEAR($E$7:$E$10070)=2006)),$H$7:$H$10070) to look down another coloumn and verify if 2 items match before giving the answer? The above has a problem and doesn't want to work. Regards David -- OSDavidL ------------------------------------------------------------------------ OSDavidL's Profile:http://www.excelforum.com/member.php?action=getinfo&userid=31305 View this thread:http://www.excelforum.com/showthread.php?threadid=509961