Tricky Quotient Formula

Aimee S.

Board Regular
Joined
Sep 28, 2010
Messages
236
Office Version
  1. 365
Platform
  1. Windows
Trying to do the following:

IF:
Condition 1: $J$3:$J$5000=1

Condition 2: $C$3:$C$5000="Base"

Condition 3: (TEXT($AF$3:$AF$5000,"mmmyyyy")=TEXT(NOW()-DAY(NOW()),"mmmyyyy"))

This third condition makes the formula only look at rows where column AF has a date value that falls during the prior month, whatever that may be relative to the current month.

THEN:
Calculate quotient where count of all values in column AV3:AV5000 is the denominator, and count of values in column AV3:AV5000 where "Under" is the value, is the numerator.

While I have Office 2010 I would prefer the answer to be in array format so folks using 2002 Excel can use this tool. :)
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Maybe this, if I understand you correctly?

=SUMPRODUCT(($J$3:$J$5000=1)*($C$3:$C$5000="Base")*(TEXT($AF$3:$AF$5000,"mmmyyyy")=TEXT(NOW()-DAY(NOW()),"mmmyyyy"))*($AV$3:$AV$5000="Under"))/SUMPRODUCT(($J$3:$J$5000=1)*($C$3:$C$5000="Base")*(TEXT($AF$3:$AF$5000,"mmmyyyy")=TEXT(NOW()-DAY(NOW()),"mmmyyyy"))*($AV$3:$AV$5000<>""))

Hope that helps.
 
Upvote 0
Sad panda face :( Was so hopeful that would work but I just get a #N/A error.
 
Upvote 0
Didn't realize quotient returned the integer value of the division, so try this:

=QUOTIENT(SUMPRODUCT(($J$3:$J$5000=1)*($C$3:$C$5000="Base")*(TEXT($AF$3:$AF$5000,"mmmyyyy")=TEXT(NOW()-DAY(NOW()),"mmmyyyy"))*($AV$3:$AV$5000="Under")),SUMPRODUCT(($J$3:$J$5000=1)*($C$3:$C$5000="Base")*(TEXT($AF$3:$AF$5000,"mmmyyyy")=TEXT(NOW()-DAY(NOW()),"mmmyyyy"))*($AV$3:$AV$5000<>"")))

Hope that helps.
 
Upvote 0
Column AV can have either #VALUE! or #N/A

That is the only column that can have those types of returns (this is to be expected in some cases and it does not occur on accident).

So I guess both the numerator and denominator would have to exclude #N/A values, and perhaps #VALUE! as well?
 
Upvote 0
Maybe try this confirmed with control+shift+enter and not just enter:

=QUOTIENT(SUMPRODUCT(($J$3:$J$5000=1)*($C$3:$C$5000="Base")*(TEXT($AF$3:$AF$5000,"mmmyyyy")=TEXT(NOW()-DAY(NOW()),"mmmyyyy"))*(IF(NOT(ISERROR($AV$3:$AV$5000)),$AV$3:$AV$5000)="Under")),SUMPRODUCT(($J$3:$J$5000=1)*($C$3:$C$5000="Base")*(TEXT($AF$3:$AF$5000,"mmmyyyy")=TEXT(NOW()-DAY(NOW()),"mmmyyyy"))*(IF(NOT(ISERROR($AV$3:$AV$5000)),$AV$3:$AV$5000)<>"")))

I didn't test this thoroughly, but it appears to work, I hope you haev what you are expected to get as results?
 
Upvote 0

Forum statistics

Threads
1,224,531
Messages
6,179,379
Members
452,907
Latest member
Roland Deschain

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