Multiple/complex criteria in Countifs

Mr_Patrick

New Member
Joined
Feb 24, 2017
Messages
8
Hi everyone,

I am working on a large dataset (+6000 entries) were each entry can be grouped pairwise, one recording some current data which will be later replaced by new data like so:

2010
2011
2012
2013
2014
2015
2016
Current
32
12
54
432
2
New
32
12
54
1
432
2
Current
53
65
4
New
4
65
8
etc
etc
etc
etc
etc
etc
etc
etc

<tbody>
</tbody>

I wish to create a function that outputs as a percentage how many new values will be added if there is currently no new value. In the example above, assuming the data is only made up of these 4 rows, the function should output 50% (because out of the 6 blank cells in the 2 "Current" lines, 3 will be filled).
My intuition tells me to work with Countifs, but unfortunately since each criteria are assembled under an AND clause, thus working with something like :
Code:
[COUNTIFS(Data!$G$2:$G$6697;"=Current";Data!K$2:K$6697;"=";Data!$G$2:$G$6697;"=New";Data!K$2:K$6697;"<>")
does not work.
I also tried to make countifs only count only even cells (all the "Current" rows are on even cells ), but this is no good. (I try to avoid building macros as I have never done this).

Anyway, does someone can suggest me something?

Thank you in advance.
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Maybe:

=SUMPRODUCT((B2:H5="")*(B3:H6<>"")*(MOD(ROW(B2:H5),2)=0))/SUMPRODUCT((B2:H5="")*(MOD(ROW(B2:H5),2)=0))

or

=SUMPRODUCT((B2:H5="")*(B3:H6<>"")*(A2:A5="Current"))/SUMPRODUCT((B2:H5="")*(A2:A5="Current"))
 
Last edited:
Upvote 0
Maybe:

=SUMPRODUCT((B2:H5="")*(B3:H6<>"")*(MOD(ROW(B2:H5),2)=0))/SUMPRODUCT((B2:H5="")*(MOD(ROW(B2:H5),2)=0))

or

=SUMPRODUCT((B2:H5="")*(B3:H6<>"")*(A2:A5="Current"))/SUMPRODUCT((B2:H5="")*(A2:A5="Current"))

Oh wow, this works. (not 100% sure why though).

Thanks Eric. I really appreciate it.
 
Upvote 0

Forum statistics

Threads
1,216,624
Messages
6,131,788
Members
449,672
Latest member
Dervint81

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