# COUNT IF FORMULA for Two Column Condition

#### Samael2021

##### New Member
DEAR SIR,
Let me ask you a little bit. I want to increase the count if (A1,B1) value is the same with (A2,B2). Can someone provide a formula for this? Please help me.
Thank you so much!!

A B C
No1 No2 Count
1 1 1
1 1 2
2 3 1
2 0 1
1 1 3

### Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

#### Radoslaw Poprawski

##### Active Member
that explanation is quite bad.

2 solutions cos I'm not sure which 1 ur after exactly

Book1
ABCDE
9ABexpetedCountCount
1011131
1111232
1223111
1320111
1411333
Sheet1
Cell Formulas
RangeFormula
D10:D14D10=COUNTIFS(\$A\$10:\$A\$14,A10,\$B\$10:\$B\$14,B10)
E10:E14E10=COUNTIFS(\$A\$10:\$A10,A10,\$B\$10:\$B10,B10)

#### Samael2021

##### New Member
that explanation is quite bad.

2 solutions cos I'm not sure which 1 ur after exactly

Book1
ABCDE
9ABexpetedCountCount
1011131
1111232
1223111
1320111
1411333
Sheet1
Cell Formulas
RangeFormula
D10:D14D10=COUNTIFS(\$A\$10:\$A\$14,A10,\$B\$10:\$B\$14,B10)
E10:E14E10=COUNTIFS(\$A\$10:\$A10,A10,\$B\$10:\$B10,B10)
Thank you so much, Sir.

glad to help.

Replies
8
Views
124
Replies
4
Views
107
Replies
3
Views
424
Replies
1
Views
80
Replies
9
Views
244

Threads
1,141,315
Messages
5,705,699
Members
421,406
Latest member
kluna90

### 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

### 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