# Matching Cells but exclude Blanks [Solved/Closed]

Ask a question Tom9o 11Posts Monday February 18, 2013Registration date September 15, 2013 Last seen - Last answered on Jul 4, 2017 at 08:18 AM by Hira
Hello,
I am trying an "IF" formula to see if A1 matches B1 and if so I want to return C1 but if the two cell are blank its working I want to exclude blanks, and it is date's that I am working with.
So if A1 contains 1/1/13 and B1 contains 1/1/13 then it is to return the value in C1. But what is happening also if A1 is blank and B1 is blank it is returning the value in C1 and I don't want that. Any help appreciated
Helpful
+2
Hi Tom9o,

If you are checking a cell for a zero value and the cell is blank, the test evaluates to true. If the range might contain a blank cell, you should use the ISBLANK function to test for a zero value, enter the below mentioned formula in C1 and it should work now:

=IF(ISBLANK(A1),"",IF(B1=A1,A1,""))

Do reply with results.
Was this answer helpful?
Hira-
amazing thanks solved my problem :)
Helpful
+0
Thanks Zohaib R,

It works a treat,

Tom9o
Helpful
+0
Just one other thing I notice when I use the formula is that if both cells are blank I want to return a blank. What I am finding is if the two cells are blank it still returns what in the cell
So if A1 contains 1/1/13 and B1 contains 1/1/13 then it is to return the value in C1. But what it is also happening if both cells are showing blank is still shows what is in C1 as it is matching the two blanks

Hope this makes sence
Helpful
+0
Hi Tom9o,

I think my previous post was not clear. I have applied the formula in a sheet have uploaded it to the below mentioned link:

http://speedy.sh/XTzvT/DateMatch.xlsx

Please download the file and check if this resolves your query.

Do reply with results.
Helpful
+0
Hi Zohaib, thank for this sory for the late answer but I have been away on business, I have open the file and it works fine but what I have noticed is that insted of the blank cell I have a formula in the cell it does not work is there anyway your formula can be change so that that it can work with a formula in the cell.

Thanks again for your help.Tom9o
Helpful
+0
Hi Tom9o,

I would like to know what error (such as #N/A, #VALUE!, #REF!, #DIV/0!, #NUM!, #NAME?, or #NULL!) you receive in cell. Or, it simply displays as blank?

Please do write back to us.
Helpful
+0
Hi Zohaib R,

It is blank, I have got the formula =IF(A1="","",A1) and the is a date that it is picking up and in the other cell the your formula is working on has =IF(B1="","",B1) and as I said using the formula that you have provided if A and B have the same date the it will give me cell C what I am finding is if the are both blank it is also giving me cell C.

Tom
Helpful
+0
Hi Tom,

I am sorry, I find it a little difficult to understand your question. In the sheet that I uploaded I have mentioned the formula =IF(ISBLANK(A2),"",IF(B2=A2,A2,"")). It is not clear from your post if you have changed my formula or you are referring to a different formula altogether. It would be helpful if you could upload the sample file to the following mentioned website:

http://www.speedyshare.com/
Helpful
+0
Hi Zohaib R,

I have uplaoded as requested did it twice as not sure if it worked first time, please let me know it you did not receive it,

Thanks Tom9o
Helpful
+0
Hi Tom,

After you upload a file on http://www.speedyshare.com/, it becomes a link. Please check the below mentioned image:

http://s23.postimg.org/p05ed6vfv/Date_Match.jpg

Copy the first link and add it to your reply.

Member requests are more likely to be responded to.

Members can monitor the statuses of their requests from their account pages.

A CCM membership gives you access to additional options.