#1   Report Post  
Posted to microsoft.public.excel.programming
Rob Rob is offline
external usenet poster
 
Posts: 718
Default criteria

This is a formula I am using
=sumif(D13:D328,1,F13:F328)
so I am checing if any cells from d13 to d328 have a 1 in them and if so to
total the sum of F13 to F328 ie d14,20 and 23 have a one in so sum f14,20 and
23. I want to add a check so I check for a 1 in d13 to d328 and e13 to e328
to then sum f13 to f328
this doesn't work =sumif(D13:D328andE13:E328,1,F13:F328)


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 461
Default criteria

Just do

=Sumif(D13:E328,1,F13:F328)

"Rob" wrote:

This is a formula I am using
=sumif(D13:D328,1,F13:F328)
so I am checing if any cells from d13 to d328 have a 1 in them and if so to
total the sum of F13 to F328 ie d14,20 and 23 have a one in so sum f14,20 and
23. I want to add a check so I check for a 1 in d13 to d328 and e13 to e328
to then sum f13 to f328
this doesn't work =sumif(D13:D328andE13:E328,1,F13:F328)


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,393
Default criteria

Do you mean you want 1 in both the D and the E ranges?
Then use:
=SUMPRODUCT(--(D13:D328=1),--(E13:E328=1),F13:F328)
or
=SUMPRODUCT((D13:D328=1)*(E13:E328=1)*(F13:F328))

For details see
http://www.xldynamic.com/source/xld.SUMPRODUCT.html
http://mcgimpsey.com/excel/formulae/doubleneg.html
best wishes
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email


"Rob" wrote in message
...
This is a formula I am using
=sumif(D13:D328,1,F13:F328)
so I am checing if any cells from d13 to d328 have a 1 in them and if so
to
total the sum of F13 to F328 ie d14,20 and 23 have a one in so sum f14,20
and
23. I want to add a check so I check for a 1 in d13 to d328 and e13 to
e328
to then sum f13 to f328
this doesn't work =sumif(D13:D328andE13:E328,1,F13:F328)




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default criteria

If I've understood correctly try:-

=SUM((D13:D328=1)*(E13:E328=1)*F13:F328)

It'san array formula so enter with CTRL+Shift+Enter

"Rob" wrote:

This is a formula I am using
=sumif(D13:D328,1,F13:F328)
so I am checing if any cells from d13 to d328 have a 1 in them and if so to
total the sum of F13 to F328 ie d14,20 and 23 have a one in so sum f14,20 and
23. I want to add a check so I check for a 1 in d13 to d328 and e13 to e328
to then sum f13 to f328
this doesn't work =sumif(D13:D328andE13:E328,1,F13:F328)


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default criteria

Rob,

=SUMPRODUCT((D13:D328=1)*(E13:E328=1)*(F13:F328))

HTH,
Bernie
MS Excel MVP


"Rob" wrote in message
...
This is a formula I am using
=sumif(D13:D328,1,F13:F328)
so I am checing if any cells from d13 to d328 have a 1 in them and if so to
total the sum of F13 to F328 ie d14,20 and 23 have a one in so sum f14,20 and
23. I want to add a check so I check for a 1 in d13 to d328 and e13 to e328
to then sum f13 to f328
this doesn't work =sumif(D13:D328andE13:E328,1,F13:F328)






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default criteria

=sumproduct(--(D13:D328=1),--(E13:E328=1),F13:F328)

--
Regards,
Tom Ogilvy

"Rob" wrote:

This is a formula I am using
=sumif(D13:D328,1,F13:F328)
so I am checing if any cells from d13 to d328 have a 1 in them and if so to
total the sum of F13 to F328 ie d14,20 and 23 have a one in so sum f14,20 and
23. I want to add a check so I check for a 1 in d13 to d328 and e13 to e328
to then sum f13 to f328
this doesn't work =sumif(D13:D328andE13:E328,1,F13:F328)


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 812
Default criteria

=SUMPRODUCT(--(D13:D328=1),--(E13:E328=1),F13:F328)

See http://www.xldynamic.com/source/xld.SUMPRODUCT.html for an
explanation.

Hth,
Merjet

  #8   Report Post  
Posted to microsoft.public.excel.programming
Rob Rob is offline
external usenet poster
 
Posts: 718
Default criteria

Thanks Tom, this worked very well until I wanted to increase the amount of
different scenarios i.e. d13:d328=2 and e13:e328=1 f13:f328
then d13:d328=1 and e13:e328=3 f13:f328

My fault, I didn't put down that I would like to be able to mix and match
differnet scenarios.

Rob

"Tom Ogilvy" wrote:

=sumproduct(--(D13:D328=1),--(E13:E328=1),F13:F328)

--
Regards,
Tom Ogilvy

"Rob" wrote:

This is a formula I am using
=sumif(D13:D328,1,F13:F328)
so I am checing if any cells from d13 to d328 have a 1 in them and if so to
total the sum of F13 to F328 ie d14,20 and 23 have a one in so sum f14,20 and
23. I want to add a check so I check for a 1 in d13 to d328 and e13 to e328
to then sum f13 to f328
this doesn't work =sumif(D13:D328andE13:E328,1,F13:F328)


  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 812
Default criteria

Then use =SUMPRODUCT(--(D13:D328=A1),--(E13:E328=B1),F13:F328)
where A1 and B1 reference cells containing whatever values you want to
test.

Hth,
Merjet


  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default criteria

you might also want to look at just creating a pivot Table report under the
data menu.

--
Regards,
Tom Ogilvy


"merjet" wrote:

Then use =SUMPRODUCT(--(D13:D328=A1),--(E13:E328=B1),F13:F328)
where A1 and B1 reference cells containing whatever values you want to
test.

Hth,
Merjet



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
=DMIN(database,field,criteria) question about criteria Dummy Excel Discussion (Misc queries) 2 April 16th 07 08:02 PM
Selection.AutoFilter Field / Criteria = criteria sometimes non-existing on worksheet markx Excel Programming 1 November 24th 06 02:52 PM
Counting Cells with multiple criteria.One criteria supporting wild Azhar Saleem Excel Worksheet Functions 1 January 12th 05 10:54 AM
Counting Cells with multiple criteria.One criteria supporting wild Azhar Arain Excel Worksheet Functions 1 January 12th 05 08:33 AM
have input box. Need criteria entered to refer to cond. format criteria Bob Phillips[_6_] Excel Programming 0 March 1st 04 08:17 PM


All times are GMT +1. The time now is 06:34 PM.

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"