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:

[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]2010
[/TD]
[TD]2011
[/TD]
[TD]2012
[/TD]
[TD]2013
[/TD]
[TD]2014
[/TD]
[TD]2015
[/TD]
[TD]2016
[/TD]
[/TR]
[TR]
[TD]Current
[/TD]
[TD]32
[/TD]
[TD]12
[/TD]
[TD][/TD]
[TD]54
[/TD]
[TD][/TD]
[TD]432
[/TD]
[TD]2
[/TD]
[/TR]
[TR]
[TD]New
[/TD]
[TD]32
[/TD]
[TD]12
[/TD]
[TD][/TD]
[TD]54
[/TD]
[TD]1
[/TD]
[TD]432
[/TD]
[TD]2
[/TD]
[/TR]
[TR]
[TD]Current
[/TD]
[TD]53
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]65
[/TD]
[TD]4
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]New
[/TD]
[TD][/TD]
[TD]4
[/TD]
[TD][/TD]
[TD][/TD]
[TD]65
[/TD]
[TD][/TD]
[TD]8
[/TD]
[/TR]
[TR]
[TD]etc
[/TD]
[TD]etc
[/TD]
[TD]etc
[/TD]
[TD]etc
[/TD]
[TD]etc
[/TD]
[TD]etc
[/TD]
[TD]etc
[/TD]
[TD]etc
[/TD]
[/TR]
</tbody>[/TABLE]

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

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
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,223,236
Messages
6,170,915
Members
452,366
Latest member
TePunaBloke

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