Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Martin Smith
 
Posts: n/a
Default Calculation conditional on yes no

I have the following formula giving me a total value of a range of
figures based on date:

=SUMPRODUCT(--(DAY(Main!$F$3:Main!$F$500)=A5),--(MONTH(Main!$F$3:Main!$F$500)=B5),Main!$C$3:Main!$ C$500)

I

want the totalisation to be done only if yes appears in another column.
I have used logic functions in the past but I am struggling to use it
in the above formula without it flagging an error or using the IF
function and I put the formula in for the true response it shows the
formula as text rather than doing the calculation.

  #2   Report Post  
JE McGimpsey
 
Posts: n/a
Default

One way:

=SUMPRODUCT(--(DAY(Main!$F$3:Main!$F$500)=A5),
--(MONTH(Main!$F$3:Main!$F$500)=B5),Main!$C$3:Main!$ C$500,
--(Main!$B$3:$B$500="Yes"))



In article ,
Martin Smith wrote:

I have the following formula giving me a total value of a range of
figures based on date:

=SUMPRODUCT(--(DAY(Main!$F$3:Main!$F$500)=A5),--(MONTH(Main!$F$3:Main!$F$500)=
B5),Main!$C$3:Main!$C$500)

I

want the totalisation to be done only if yes appears in another column.
I have used logic functions in the past but I am struggling to use it
in the above formula without it flagging an error or using the IF
function and I put the formula in for the true response it shows the
formula as text rather than doing the calculation.

  #3   Report Post  
Duke Carey
 
Posts: n/a
Default

Maybe:

=SUMPRODUCT(--(other
range="yes"),--(DAY(Main!$F$3:Main!$F$500)=A5),--(MONTH(Main!$F$3:Main!$F$500)=B5),Main!$C$3:Main!$ C$500)

"Martin Smith" wrote:

I have the following formula giving me a total value of a range of
figures based on date:

=SUMPRODUCT(--(DAY(Main!$F$3:Main!$F$500)=A5),--(MONTH(Main!$F$3:Main!$F$500)=B5),Main!$C$3:Main!$ C$500)

I

want the totalisation to be done only if yes appears in another column.
I have used logic functions in the past but I am struggling to use it
in the above formula without it flagging an error or using the IF
function and I put the formula in for the true response it shows the
formula as text rather than doing the calculation.


  #4   Report Post  
Martin Smith
 
Posts: n/a
Default

On 2005-05-23 14:11:50 +0100, Martin Smith
said:

I have the following formula giving me a total value of a range of
figures based on date:

=SUMPRODUCT(--(DAY(Main!$F$3:Main!$F$500)=A5),--(MONTH(Main!$F$3:Main!$F$500)=B5),Main!$C$3:Main!$ C$500)


I
want

the totalisation to be done only if yes appears in another column. I
have used logic functions in the past but I am struggling to use it in
the above formula without it flagging an error or using the IF function
and I put the formula in for the true response it shows the formula as
text rather than doing the calculation.

Thanks for the suggestions.

I had run the formula on a "calc" sheet then did a separate logic
formula but your suggestions are much cleaner and efficient.

  #5   Report Post  
Martin Smith
 
Posts: n/a
Default

On 2005-05-23 14:23:04 +0100, "Duke Carey"
said:

Maybe:
=SUMPRODUCT(--(other
range="yes"),--(DAY(Main!$F$3:Main!$F$500)=A5),--(MONTH(Main!$F$3:Main!$F$500)=B5),Main!$C$3:Main!$ C$500)


"Martin

Smith" wrote:

I have the following formula giving me a total value of a range of
figures based on date:

=SUMPRODUCT(--(DAY(Main!$F$3:Main!$F$500)=A5),--(MONTH(Main!$F$3:Main!$F$500)=B5),Main!$C$3:Main!$ C$500)


I
want

the totalisation to be done only if yes appears in another column. I
have used logic functions in the past but I am struggling to use it in
the above formula without it flagging an error or using the IF function
and I put the formula in for the true response it shows the formula as
text rather than doing the calculation.

On my main sheet the "yes" and "no" are from G7 onwards but the formula


=SUMPRODUCT(--(Main!$G$7:Main!$G$500="yes")--(DAY(Main!$F$7:Main!$F$504)=A9),--(MONTH(Main!$F$7:Main!$F$504)=B9),Main!$C$7:Main!$ C$504)

Gives

a result of #N/A



  #6   Report Post  
Martin Smith
 
Posts: n/a
Default

On 2005-05-26 16:18:56 +0100, Martin Smith
said:

UMPRODUCT(--(Main!$G$7:Main!$G$500="yes")--(DAY(Main!$F$7:Main!$F$504)=A9),--(MONTH(Main!$F$7:Main!$F$504)=B9),Main!$C$7:Main!$ C$504)


Gives
a

result of #N/A

I think that there was a missing comma

=SUMPRODUCT(--(Main!$G$7:Main!$G$500="Yes"),--(DAY(Main!$F$7:Main!$F$504)=A9),--(MONTH(Main!$F$7:Main!$F$504)=B9),Main!$C$7:Main!$ C$504)

But

it still gives #VALUE!

  #7   Report Post  
Martin Smith
 
Posts: n/a
Default

On 2005-05-26 16:22:18 +0100, Martin Smith
said:

On 2005-05-26 16:18:56 +0100, Martin Smith
said:

UMPRODUCT(--(Main!$G$7:Main!$G$500="yes")--(DAY(Main!$F$7:Main!$F$504)=A9),--(MONTH(Main!$F$7:Main!$F$504)=B9),Main!$C$7:Main!$ C$504)


Gives
a
result

of #N/A

I think that there was a missing comma


=SUMPRODUCT(--(Main!$G$7:Main!$G$500="Yes"),--(DAY(Main!$F$7:Main!$F$504)=A9),--(MONTH(Main!$F$7:Main!$F$504)=B9),Main!$C$7:Main!$ C$504)


But
it

still gives #VALUE!

Solved it. Sorry for the premature posts. the G500 reference must be
G504 in line with the other range selections


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
How do i create a conditional sum? tmiller708 Excel Worksheet Functions 2 May 5th 05 01:58 AM
Help, Multiple conditional calculation wwj New Users to Excel 4 March 10th 05 09:05 PM
How do I use a rounded calculation result in another calculation? vnsrod2000 Excel Worksheet Functions 1 January 26th 05 10:11 PM
How do I use a rounded calculation result in another calculation? vnsrod2000 Excel Worksheet Functions 1 January 26th 05 09:36 PM
Conditional formatting not available in Excel BAB Excel Discussion (Misc queries) 2 January 1st 05 03:33 PM


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