Count only if immediate right cell is blank...sort of.

kitteyrin

New Member
Joined
Feb 20, 2016
Messages
4
So I have a mess I'm trying to work with. What I'm trying to do is if column G or H has a date in it (isn't blank), count the cell as 1 and return the number. While I don't have an issue with that part, my complication comes in if there's a value (not blank) in column H- that is, it counts it twice. What I need to do is only count it only once even if H has something written in it. However, sometimes only H column is filled, and I still need that column to be counted. Further, I also need it to automatically subtract from the total if column J has the text "Rem'd", "Redefault", or "Disputing" in it.

Here are the various equations I've tried, starting with my original one:

=COUNTA(G2:H2019)-(COUNTIF(J:J,"*REDEFAULT*")+COUNTIF(J:J,"*DISPUTING*")+COUNTIF(J:J,"*REM'D*"))

=COUNTIF(G2:G2012,AND(G2:G2012="<>"&"",H2:H2012=""))

=COUNTIF(G2:G2012,AND(G2:G2012="<>"&"",H2:H2012=""))-(COUNTIF(J:J,"*REDEFAULT*")+COUNTIF(J:J,"*DISPUTING*")+COUNTIF(J:J,"*REM'D*"))

=COUNTA(AND(G2:G2012="<>"&"",H2:H2012=""))-(COUNTIF(J:J,"*REDEFAULT*")+COUNTIF(J:J,"*DISPUTING*")+COUNTIF(J:J,"*REM'D*"))

In order, the above equations return 4, 0, -16, and -15

My data is below, and what I need it to return is 1 for the displayed data, or if all the notes in J is removed, 17.


[table="width: 500"]
[tr]
[td]G[/td]
[td]H[/td]
[td]I[/td]
[td]J[/td]
[/tr]
[tr]
[td][/td]
[td][/td]
[td]x[/td]
[td]February Complete[/td]
[/tr]
[tr]
[td][/td]
[td][/td]
[td]x[/td]
[td][/td]
[/tr]
[tr]
[td]02/04/2016[/td]
[td][/td]
[td]x[/td]
[td]Rem'd[/td]
[/tr]
[tr]
[td]02/05/2016[/td]
[td]02/08/2016[/td]
[td][/td]
[td]Rem'd[/td]
[/tr]
[tr]
[td]02/05/2016[/td]
[td]02/08/2016[/td]
[td][/td]
[td]Rem'd[/td]
[/tr]
[tr]
[td]02/04/2016[/td]
[td][/td]
[td]x[/td]
[td]Rem'd[/td]
[/tr]
[tr]
[td][/td]
[td][/td]
[td]x[/td]
[td][/td]
[/tr]
[tr]
[td]02/16/2016[/td]
[td][/td]
[td]x[/td]
[td]Rem'd[/td]
[/tr]
[tr]
[td][/td]
[td][/td]
[td]x[/td]
[td][/td]
[/tr]
[tr]
[td]02/17/2016[/td]
[td][/td]
[td]x[/td]
[td]Rem'd[/td]
[/tr]
[tr]
[td]02/17/2016[/td]
[td][/td]
[td]x[/td]
[td]Rem'd[/td]
[/tr]
[tr]
[td]02/05/2016[/td]
[td][/td]
[td]x[/td]
[td]Rem'd[/td]
[/tr]
[tr]
[td]02/18/2016[/td]
[td][/td]
[td]x[/td]
[td]Rem'd[/td]
[/tr]
[tr]
[td]02/19/2016[/td]
[td][/td]
[td]x[/td]
[td]Rem'd[/td]
[/tr]
[tr]
[td][/td]
[td][/td]
[td]x[/td]
[td][/td]
[/tr]
[tr]
[td][/td]
[td][/td]
[td]x[/td]
[td][/td]
[/tr]
[tr]
[td]02/24/2016[/td]
[td][/td]
[td]x[/td]
[td]Rem'd[/td]
[/tr]
[tr]
[td]02/24/2016[/td]
[td]02/26/2016[/td]
[td][/td]
[td][/td]
[/tr]
[tr]
[td]02/23/2016[/td]
[td][/td]
[td]x[/td]
[td]Rem'd[/td]
[/tr]
[tr]
[td]02/24/2016[/td]
[td][/td]
[td]x[/td]
[td]Rem'd[/td]
[/tr]
[tr]
[td]02/18/2016[/td]
[td][/td]
[td][/td]
[td]Disputing[/td]
[/tr]
[tr]
[td]02/26/2016[/td]
[td][/td]
[td]x[/td]
[td]Rem'd[/td]
[/tr]
[tr]
[td][/td]
[td][/td]
[td]x[/td]
[td][/td]
[/tr]
[tr]
[td][/td]
[td][/td]
[td]x[/td]
[td][/td]
[/tr]
[tr]
[td][/td]
[td][/td]
[td]x[/td]
[td][/td]
[/tr]
[tr]
[td][/td]
[td]02/04/2016[/td]
[td][/td]
[td]Redefault[/td]
[/tr]
[tr]
[td][/td]
[td][/td]
[td]x[/td]
[td][/td]
[/tr]
[tr]
[td][/td]
[td][/td]
[td]x[/td]
[td][/td]
[/tr]
[tr]
[td][/td]
[td][/td]
[td][/td]
[td][/td]
[/tr]
[/table]



Could anyone help me please? I'm willing to provide more information as needed, considering I'm not sure what other information may possibly be required to solve my issue.
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
That formula returns a 1 for the table I put in, but if I remove any of the "Rem'd" on line J it doesn't change to 2.
 
Upvote 0
Hi,

Not elegant, but does what you requested:


Excel 2010
GHIJKL
1xFebruary Complete1
2x
32/4/2016xRem'd
42/5/20162/8/2016Rem'd
52/5/20162/8/2016Rem'd
62/4/2016xRem'd
7x
82/16/2016xRem'd
9x
102/17/2016xRem'd
112/17/2016xRem'd
122/5/2016xRem'd
132/18/2016xRem'd
142/19/2016xRem'd
15x
16x
172/24/2016xRem'd
182/24/20162/26/2016
192/23/2016xRem'd
202/24/2016xRem'd
212/18/2016Disputing
222/26/2016xRem'd
23x
24x
25x
262/4/2016Redefault
27x
28x
Sheet1
Cell Formulas
RangeFormula
L1=COUNTIFS(H1:H28,"",G1:G28,"<>"&"")+COUNTIFS(I1:I28,"",H1:H28,"<>"&"")-SUM(COUNTIF(J1:J28,{"Rem'd","Redefault","Disputing"}))
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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