Countifs Function Help Needed

LearnExcl

Board Regular
Joined
Mar 17, 2010
Messages
245
Office Version
  1. 2016
Platform
  1. Windows
Good morning Excel Gurus!

I have an updated name roster listed under on B1:B240 on Sheet1. I also have a database of names on B1:B240, C1:C240 and D1:D240 on Sheet2. I would like to crosscheck the database against the updated roster to see if there are any new personnel additions. In other words, I want to see if what I am showing matches with the updated roster. In this manner, I would like to construct a formula on C1 on Sheet2 to say:
If any of the names on B1:B240, C1:C240 and D1:D240 on Sheet2 have an exact match with the names appearing on B1:B240 on Sheet1, then give me that name, if not, give me nothing ("").

I have tried the countifs function, but had difficulty returning the names I wanted. Any help will be greatly appreciated.
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Hi,

Does this work for you?


Excel Workbook
BCD
1Name1Name2Name3
2ColColinColeen
3CamDexDen
4joeJoJoey
5BillBillyWill
6BobBobbyRob
7BenfredTed
8JimTimTom
Sheet2




Excel Workbook
BC
1NameMatch
2BillBill
3BobBob
4Ak*
5Terry*
6JoJo
Sheet1


You will need to change the cell references to suit yours.

=IF(COUNTIF(Sheet2!$B$1:$D$240,B1)>0,B1,"")

I hope that works.

Ak
 
Upvote 0
Hi Ak,

Thank you for your reply. However, I believe I was not able to clearly explain what I needed. In your example, I am actually crosschecking Sheet2 against Sheet1. In this case, what I need is, if any one of the names appearing on Sheet2 have an exact match with any one of the names appearing on Sheet1, then give me nothing, but if not, give me that name.
So, the formula I am trying to use is =IF(COUNTIF($B$1:$B$240,
'Sheet2'B1:D240)>0,"",'Sheet2'B1:D240).
Now, the problem with this formula is that I have criteria covering multiple cells, thus returning me the "#VALUE!" error. I just could not discover how to construct a formula to cite multiple criteria. Maybe I should use a different function instead.
Appreciate your help on this.
 
Upvote 0
Good morning Excel Gurus!

I have an updated name roster listed under on B1:B240 on Sheet1. I also have a database of names on B1:B240, C1:C240 and D1:D240 on Sheet2. I would like to crosscheck the database against the updated roster to see if there are any new personnel additions. In other words, I want to see if what I am showing matches with the updated roster. In this manner, I would like to construct a formula on C1 on Sheet2 to say:
If any of the names on B1:B240, C1:C240 and D1:D240 on Sheet2 have an exact match with the names appearing on B1:B240 on Sheet1, then give me that name, if not, give me nothing ("").

I have tried the countifs function, but had difficulty returning the names I wanted. Any help will be greatly appreciated.
Sheet2

E1, enter and copy down:
Code:
=LOOKUP(9.99999999999999E+307,1/CHOOSE({1,2,3},
    ISNA(MATCH(B1,Sheet1!$B$1:$B$240,0)),
    ISNA(MATCH(C1,Sheet1!$B$1:$B$240,0)),
    ISNA(MATCH(D1,Sheet1!$B$1:$B$240,0))),B1:D1)
 
Upvote 0
Hi Aladin,

I tried your formula, but did not get what I wanted. I am placing this formula on Sheet1, so I am just wondering how is this formula going to crosscheck against the values on Sheet2 without any reference to it? Could that be the problem you think? I also have headers for all three columns under Sheet2 as well as the column on Sheet1.
 
Upvote 0
Hi Aladin,

I tried your formula, but did not get what I wanted. I am placing this formula on Sheet1, so I am just wondering how is this formula going to crosscheck against the values on Sheet2 without any reference to it? Could that be the problem you think? I also have headers for all three columns under Sheet2 as well as the column on Sheet1.

The formula goes in E1 on Sheet2, not on Sheet1.
 
Upvote 0
Hi Aladin,

I tried your formula, but did not get what I wanted. I am placing this formula on Sheet1, so I am just wondering how is this formula going to crosscheck against the values on Sheet2 without any reference to it? Could that be the problem you think? I also have headers for all three columns under Sheet2 as well as the column on Sheet1.

Let's recap. Your original post is not very clear.
Condider the following samples:

Sheet1, B1:B9, with B1 housing a header...

<TABLE style="WIDTH: 48pt; BORDER-COLLAPSE: collapse" border=0 cellSpacing=0 cellPadding=0 width=64><COLGROUP><COL style="WIDTH: 48pt" width=64><TBODY><TR style="HEIGHT: 14.4pt" height=19><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; WIDTH: 48pt; HEIGHT: 14.4pt; BORDER-TOP: windowtext 0.5pt solid; BORDER-RIGHT: windowtext 0.5pt solid" class=xl66 height=19 width=64>List1</TD></TR><TR style="HEIGHT: 14.4pt" height=19><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; HEIGHT: 14.4pt; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid" class=xl65 height=19>FAD</TD></TR><TR style="HEIGHT: 14.4pt" height=19><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; HEIGHT: 14.4pt; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid" class=xl65 height=19>DAD</TD></TR><TR style="HEIGHT: 14.4pt" height=19><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; HEIGHT: 14.4pt; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid" class=xl65 height=19>LAD</TD></TR><TR style="HEIGHT: 14.4pt" height=19><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; HEIGHT: 14.4pt; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid" class=xl65 height=19>KAD</TD></TR><TR style="HEIGHT: 14.4pt" height=19><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; HEIGHT: 14.4pt; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid" class=xl65 height=19>VAD</TD></TR><TR style="HEIGHT: 14.4pt" height=19><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; HEIGHT: 14.4pt; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid" class=xl65 height=19>XAD</TD></TR><TR style="HEIGHT: 14.4pt" height=19><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; HEIGHT: 14.4pt; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid" class=xl65 height=19>GAG</TD></TR><TR style="HEIGHT: 14.4pt" height=19><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; HEIGHT: 14.4pt; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid" class=xl65 height=19>PAD</TD></TR></TBODY></TABLE>

Sheet2, B1:D5, with B1:D1 housing headers...

<TABLE style="WIDTH: 144pt; BORDER-COLLAPSE: collapse" border=0 cellSpacing=0 cellPadding=0 width=192><COLGROUP><COL style="WIDTH: 48pt" span=3 width=64><TBODY><TR style="HEIGHT: 14.4pt" height=19><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; WIDTH: 48pt; HEIGHT: 14.4pt; BORDER-TOP: windowtext 0.5pt solid; BORDER-RIGHT: windowtext 0.5pt solid" class=xl66 height=19 width=64>Blist</TD><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; WIDTH: 48pt; BORDER-TOP: windowtext 0.5pt solid; BORDER-RIGHT: windowtext 0.5pt solid" class=xl66 width=64>Clist</TD><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; WIDTH: 48pt; BORDER-TOP: windowtext 0.5pt solid; BORDER-RIGHT: windowtext 0.5pt solid" class=xl66 width=64>Dlist</TD></TR><TR style="HEIGHT: 14.4pt" height=19><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; HEIGHT: 14.4pt; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid" class=xl65 height=19>JAD</TD><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid" class=xl65>LAD</TD><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid" class=xl65>KAD</TD></TR><TR style="HEIGHT: 14.4pt" height=19><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; HEIGHT: 14.4pt; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid" class=xl65 height=19>FAD</TD><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid" class=xl65>DAD</TD><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid" class=xl65>NAD</TD></TR><TR style="HEIGHT: 14.4pt" height=19><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; HEIGHT: 14.4pt; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid" class=xl65 height=19>FAD</TD><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid" class=xl65>LAD</TD><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid" class=xl65>DAD</TD></TR><TR style="HEIGHT: 14.4pt" height=19><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; HEIGHT: 14.4pt; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid" class=xl65 height=19>JAD</TD><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid" class=xl65>VAD</TD><TD style="BORDER-BOTTOM: windowtext 0.5pt solid; BORDER-LEFT: windowtext; BACKGROUND-COLOR: transparent; BORDER-TOP: windowtext; BORDER-RIGHT: windowtext 0.5pt solid" class=xl65>XAD</TD></TR></TBODY></TABLE>

Given above, care to specify what desired results are?
 
Upvote 0
That's exactly right. The only difference is that my cell references are different and I have other data in between column B and C, and column C and D under Sheet 2. I will, though, need to place the formula on Sheet1.
By the way, I cannot thank you enough for taking time to help me with my issue - it is certainly very much appreciated.
 
Upvote 0
That's exactly right. The only difference is that my cell references are different and I have other data in between column B and C, and column C and D under Sheet 2. I will, though, need to place the formula on Sheet1.
By the way, I cannot thank you enough for taking time to help me with my issue - it is certainly very much appreciated.

What must the formula on Sheet1 bring about given the above samples?
 
Upvote 0
Consider I have other information on Column C and E and the name columns are actually B1:B9, D1:D9 and F1:F9 with B1, D1 and F1 housing headers on Sheet2. And the info on Sheet1 stays the same.

I need to place the formula in C2 on Sheet1 to say:

If any of the names appearing in B2:B9, D2:D9 and F2:F9 on Sheet2 have an exact match with any of the names on Sheet1 (Column B2:B9), then give me nothing, but if not, give me that name.

I hope it makes sense. Please let me know if you need any further info.
 
Upvote 0

Forum statistics

Threads
1,224,543
Messages
6,179,429
Members
452,914
Latest member
echoix

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