Countif contra formula

kingjet

New Member
Joined
Apr 30, 2024
Messages
20
Office Version
  1. 365
Platform
  1. Windows
Hi All,



I thought this formula was working as it did find a lot of contra entries, which then shown in column AJ a 1 or 2 – 2 meant it has a matching contra based on the concat in AI, 1 meant it cannot find a matching entry



I was happy until I randomly checked an amount (180) and realised it as 1 when it should have been 2



In column AD it counts how many 180 there are above (its filtered on 180) - its got over 100,000 lines so if you look at cell AI 971, at the end it says 180-4, this is because it looks at column AD and see how many times before 180 has come - so it says its seen 180- 4 times before ( i am trying to net the same figures) problem is row 973 should match 971 but BECAUSE the concat at the end says 180-4 & 180-1 it counts that as two separate lines (non matching) and gives me the incorrect number 1 in column AJ


if you look at column AI cells 971 and 973 they are exactly the same and should net off, but due to concat and countifs it doesn’t match, it thinks its different

I also I think need the countifs formula in Column AI as it if do not the countif in column AJ will show more numbers than 1 or 2 which is incorrect



As an exercise I deleted the 180’s in cells AD 73,136,220 and guess what the cell AJ 971/972 show a 2


btw the concat is the invoice number, client name, and the amount - to make it very unique
 

Attachments

  • hello capture 180.PNG
    hello capture 180.PNG
    66 KB · Views: 26
Hello picture 1 shows my same formulas : where your D2:J2 mine is AU2:AY2 - ive purposely shown you the formulas

picture 2 - shows that there are two 142 amounts and they should not be 2 in column AY

picture 3 shows - many numbers in AY- i was expecting 2 for all matching and 1 for no matching - but i have 1,2,3,4,15,16,17,18 etc
 

Attachments

  • pciture 1.PNG
    pciture 1.PNG
    110.8 KB · Views: 14
  • pciture 2.PNG
    pciture 2.PNG
    105.8 KB · Views: 12
  • pciture 3.PNG
    pciture 3.PNG
    125.1 KB · Views: 14
Upvote 0

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
sorry in your formula for J2 you are doing from D2 to D39 but in G2 go all the way down to 33515. in my formula in j2 i go down to 33515 too?
 
Upvote 0
i have tried imiating my file for you

XL22XB test.xlsx
ABCDEFGH
1Invoice NumberSum of RevenueABSCountifConcatCountifCountifs
2CSOL-13909469959951995CSOL-1390946-123
3CSOL-139094699.599.5199.5CSOL-1390946-111
4CSOL-13909471953195311953CSOL-1390947-111
5CSOL-1390946-9959951995CSOL-1390946-123
6CSOL-1390946-9959952995CSOL-1390946-213
7CSOL-1390951368.15368.151368.15CSOL-1390951-111
8CSOL-13909513783781378CSOL-1390951-111
9CSOL-13909533040.23040.213040.2CSOL-1390953-111
10CSOL-13909546220.416220.4116220.41CSOL-1390954-111
11CSOL-13909572077.692077.6912077.69CSOL-1390957-111
12CSOL-13909602059.442059.4412059.44CSOL-1390960-111
13CSOL-13909611696.61696.611696.6CSOL-1390961-111
14CSOL-1390962565.64565.641565.64CSOL-1390962-111
15CSOL-1390963678.19678.191678.19CSOL-1390963-111
16CSOL-13909633049.363049.3613049.36CSOL-1390963-111
17CSOL-1390964884.34884.341884.34CSOL-1390964-111
18CSOL-13909641244.821244.8211244.82CSOL-1390964-111
19CSOL-1390964548.2548.21548.2CSOL-1390964-111
20CSOL-13909644594.644594.6414594.64CSOL-1390964-111
21CSOL-13910751801801180CSOL-1391075-111
22CSOL-13912081801802180CSOL-1391208-211
23CSOL-13912521801803180CSOL-1391252-311
24CSOL-13915111801804180CSOL-1391511-412
25CSOL-1391511-1801801180CSOL-1391511-112
26CSOL-1391304142.86142.861142.86CSOL-1391304-112
27CSOL-1391304142.86142.862142.86CSOL-1391304-212
28CSOL-1393201142.86142.865142.86CSOL-1393201-512
29CSOL-1393201142.86142.866142.86CSOL-1393201-612
30CSOL-1394959142.86142.8610142.86CSOL-1394959-1012
31CSOL-1394959142.86142.8611142.86CSOL-1394959-1112
32CSOL-1396996142.86142.8615142.86CSOL-1396996-1512
33CSOL-1396996142.86142.8616142.86CSOL-1396996-1612
34CSOL-1399024142.86142.8618142.86CSOL-1399024-1812
35CSOL-1399024142.86142.8619142.86CSOL-1399024-1912
36CSOL-1401451142.86142.8622142.86CSOL-1401451-2212
37CSOL-1401451142.86142.8623142.86CSOL-1401451-2312
38
39also in this column in the original file I have more than 2 - so I have 1,2,4,5,6,7,8 - I really want to see 2 and 1
Sheet1
Cell Formulas
RangeFormula
D2:D20D2=ABS(C2)
E2:E20E2=COUNTIF($C$2:C2,C2)
F2:F20F2=CONCATENATE(D2,A2,B2,"-",E2)
G2:G25G2=COUNTIF($F$2:$F$33516,F2)
H2:H25H2=COUNTIFS($D$2:$D$33516,D2,$A$2:$A$33516,A2)
 
Upvote 0
Hi,


If you have a result of 4 and only expecting a result of max 2, this would mean the combination of invoice number, client name, and the amount isn't unique in your file while it is in the sample file. You'll need to find a better concat combination to identy the 2 lines belonging together. I can't help you with your data in the example isn't matching with the file you need it for.
 
Upvote 0

Forum statistics

Threads
1,224,814
Messages
6,181,128
Members
453,021
Latest member
Justyna P

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