If Statement to compare multiple fields

nancybrown

Well-known Member
Joined
Apr 7, 2005
Messages
868
I have two separate spreadsheets that I need to compare against each other. One spreadsheet is our client's report that shows client name (A2:A100), Start Date (B2:B100), End Date (C2:C100). Spreadsheet two is ours and contains the same fields.

I need to compare our spreadsheet against the client's spreadsheet to insure all records in the clients spreadsheet are accounted for in our spreadsheet.

I've consolidated both spreadsheets into one workbook on the same tab.


Client: Column A2:A100 (name) AND Column B2:B100 (Start Date) AND Column C2:C100 (End Date)
Ours: Column E2:E100 (name) AND Column F2:F100 (Start Date) AND Column G2:G100 (End Date)

If all conditions match "Yes","No"

Can someone provide an IF Statement please?
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Assuming no extra spaces, strange characters, etc. in either your data or the clients. In H2 entered as an array formula (confirm using shift+ctrl+enter not just enter) and copy down to cover your data:
Code:
=IF(ISNA(MATCH(E2&F2&G2,$A$2:$A$10&$B$2:$B$10&$C$2:$C$10,0)),"No","Yes")
 
Upvote 0
Hi,

Does this help?.....

Excel Workbook
ABCDEFGHIJK
1NameStart DateEnd DateNameStart DateEnd DateResult1Result2
2Bill01/03/201308/03/2013Billy01/03/201308/03/2013NoNo
3Bob02/03/201309/03/2013Bob02/03/201309/03/2013YesYes
4Ben03/03/201310/03/2013Benny03/03/201310/03/2013NoNo
5Dan04/03/201311/03/2013Dan04/03/201311/03/2013YesYes
6Den05/03/201312/03/2013Den05/03/201312/03/2013YesYes
7Don06/03/201313/03/2013Donny06/03/201313/03/2013NoNo
8Jim07/03/201314/03/2013Jim07/03/201314/03/2013YesYes
9Jon08/03/201315/03/2013Jon08/03/201315/03/2013YesYes
10Jed09/03/201316/03/2013Jed09/03/201316/03/2013YesYes
11Ted10/03/201317/03/2013Ted10/03/201317/03/2013YesYes
12Tom11/03/201318/03/2013Tommy11/03/201318/03/2013NoNo
13Tim12/03/201319/03/2013Tim12/03/201319/03/2013YesYes
14
Sheet2


The formulas need to be copied down and you can choose which one you prefer.

I hope that works.

Ak
 
Upvote 0
Hi Joe, I moved flields around slightly . . . This is the last row of code, each row is returning results as Yes even when they don't match and when columns A through C are blank. :(

=IF(ISNA(MATCH(E51&F51&G51,$A$2:$A$100&$B$2:$B$100&$C$2:$C$100,0)),"No","Yes")
 
Upvote 0
I do have this code that compares one column against another, I'm not sure if it can be modified to do multiple fields or not.

=IF(E25="","",_xlfn.IFERROR(VLOOKUP(E25,$T$4:$T$1487,1,0),"No"))
 
Upvote 0
Hi Joe, I moved flields around slightly . . . This is the last row of code, each row is returning results as Yes even when they don't match and when columns A through C are blank. :(

=IF(ISNA(MATCH(E51&F51&G51,$A$2:$A$100&$B$2:$B$100&$C$2:$C$100,0)),"No","Yes")
Sounds like you did not enter the formula as an array formula. If you enter it as an array formula, after the entry you should see curly braces around it in the formula bar like this:

{=IF(ISNA(MATCH(E51&F51&G51,$A$2:$A$100&$B$2:$B$100&$C$2:$C$100,0)),"No","Yes")}

Read my first post again for directions on entering an array formula.
 
Last edited:
Upvote 0
Sorry Joe, not sure how to do this . . . If I enter the formula as you have done with {} the results return as all "No"
 
Upvote 0
Hi,

Excel Workbook
ABCDEFGHIJKL
1NameStart DateEnd Date
2Bill01/03/201308/03/2013
3Bob02/03/201309/03/2013
4Ben03/03/201310/03/2013
5Dan04/03/201311/03/2013
6Den05/03/201312/03/2013
7Don06/03/201313/03/2013
8Jim07/03/201314/03/2013
9Jon08/03/201315/03/2013
10Jed09/03/201316/03/2013
11Ted10/03/201317/03/2013
12Tom11/03/201318/03/2013
13Tim12/03/201319/03/2013
14
50NameStart DateEnd DateResult1Result2Result3
51Billy01/03/201308/03/2013NoNoNo
52Bob02/03/201309/03/2013YesYesYes
53Benny03/03/201310/03/2013NoNoNo
54Dan04/03/201311/03/2013YesYesYes
55Den05/03/201312/03/2013YesYesYes
56Donny06/03/201313/03/2013NoNoNo
57Jim07/03/201314/03/2013YesYesYes
58Jon08/03/201315/03/2013YesYesYes
59Jed09/03/201316/03/2013YesYesYes
60Ted10/03/201317/03/2013YesYesYes
61Tommy11/03/201318/03/2013NoNoNo
62Tim12/03/201319/03/2013YesYesYes
63
Sheet2


You can use any of these formulas to achieve what you want.
The formula in I2 needs to be copied down.
The formula in J2 needs to be copied down.
The formula in K2 needs to be entered pressing ctrl shift enter NOT just enter, you can then copy it down.

I hope that helps.

Ak
 
Last edited:
Upvote 0
Sorry Joe, not sure how to do this . . . If I enter the formula as you have done with {} the results return as all "No"

Enter like this in row 51, say cell H51 for example:
1. Copy the formula below, then select cell H51 (or any cell you want it in) and paste to the cell, but don't press enter.
2. With your cursor in the formula bar, hold down the shift and Ctrl keys and press the Enter key. You should now see the curly brackets surrounding the formula. Now you can copy the formula to other cells to cover your data range.

=IF(ISNA(MATCH(E51&F51&G51,$A$2:$A$100&$B$2:$B$100&$C$2:$C$100,0)),"No","Yes")
 
Upvote 0

Forum statistics

Threads
1,203,242
Messages
6,054,354
Members
444,718
Latest member
r0nster

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