COUNTIF formula - help adding more to it

jamstr

New Member
Joined
Aug 23, 2017
Messages
1
Hi there

I have a spreadsheet (12000+ rows). Column A has lots of names but essentially only about 20 different ones.
Column B has values, many positive and negative numbers, that cancel themselves out.

I want to delete the rows that cancel themselves out BUT only if the text in Column A is the same. I can do the first part but cannot expand on the formula.
If I filter on A to only show one name the following formula works. If I expand it to be all rows then the answer is wrong.
=COUNTIF($B$2:$B$100,B2)<>COUNTIF($B$2:$B$100,-B2)

Example 1:
Apple
12.46​
TRUE
Apple
3.45​
FALSE
Apple
-3.45​
FALSE

<tbody>
</tbody>

Example 2:
Apple
12.46​
FALSE
Apple3.45FALSE
Apple-3.45FALSE
Pear8.20TRUE
Pear-12.46FALSE
Bananas15.22TRUE

<tbody>
</tbody>

Can I have a formula that works like example 1 but checks to see if the text in A is the same?
=COUNTIF($B$2:$B$100,B2)<>COUNTIF($B$2:$B$100,-B2) only if A = A

Thanks
Stef
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Hi, welcome to the forum!

Maybe you could use COUNTIFS() to also test that column A matches:

=COUNTIFS($A$2:$A$100,A2,$B$2:$B$100,B2)<>COUNTIFS($A$2:$A$100,A2,$B$2:$B$100,-B2)
 
Upvote 0

Forum statistics

Threads
1,215,753
Messages
6,126,677
Members
449,327
Latest member
John4520

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