# Matching 2 columns of data Pass Fail or Blank

1. ## Matching 2 columns of data Pass Fail or Blank

I am currently utilizing 3 columns with the following formula in the 3rd column
=IF(D4=C4,"PASSED","FAILED")
My problem is that if D4 and C4 have no data entered the E4 column displays PASSED while I need E4 to be blank if D4 and C4 have no data entered. Can you please help? Thanks.

2. ## Re: Matching 2 columns of data Pass Fail or Blank

Hi,

how about not only checking if they are equal, but also if they have data. COUNTA counts the number of cells with values, so if one of the cells is empty, COUNTA(C4:D4) would be less than 2....

=IF(COUNTA(C4:D4)=2,IF(D4=C4,"PASSED","FAILED"),"")

So, Excel first checks if the number of entries in C4 and D4 is 2, if so, it checks if they are equal and assigns the Passed and Failed. If C4 and D4 are not both filled with data, Excel returns a blank.

HTH

##### Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1