Counting entries on condition

rex759

Well-known Member
Joined
Nov 8, 2004
Messages
608
Office Version
  1. 365
Platform
  1. Windows
Hello,

I was using a COUNTIF formula to count the number of times a number starting with a 3 or 4 is found in a row. Works fine until someone’s ID appears more than once. Is it possible to have a formula add the rows together if duplicated without adding a helper column with unique entries? The results I am looking for are in column F.

This is the formula I was using

COUNTIF(B2:D2,3&"*")+COUNTIF(B2:D2,4&"*")

Book1
ABCDEF
1IDInput-1Input-2Input-3Results
21777733-244-12
317333Audit36-11
41744447-11
51755541-21
61766632-133-93
71766644-5
81798736-71
Sheet1
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Is this what you mean?

23 12 12.xlsm
ABCDEFG
1IDInput-1Input-2Input-3Results
21777733-244-122
317333Audit36-111
41744447-111
51755541-211
61766632-133-933
71766644-5 
81798736-711
Count
Cell Formulas
RangeFormula
G2:G8G2=IF(COUNTIF(A$2:A2,A2)=1,SUMPRODUCT((A$2:A$8=A2)*((LEFT(B$2:D$8,1)="3")+(LEFT(B$2:D$8,1)="4"))),"")
 
Upvote 0
Solution
Excel Formula:
=if(countif("A$1:a1,a2),"",count(0/(s$2:a$8=a2)/(--left(b$2:d$8)={3,4}))
 
Upvote 0
Thank you for the quick response! I tried Peter's first and it worked perfectly. Much appreciated
 
Upvote 0
You're welcome. Thanks for the follow-up. :)

(The other suggestion is not a valid formula so would not work - at least in its current form)
 
Upvote 0

Forum statistics

Threads
1,215,261
Messages
6,123,930
Members
449,134
Latest member
NickWBA

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