Solved

formula for reporting blanks and matches in excel

Posted on 2014-03-21
3
376 Views
Last Modified: 2014-03-21
In Excel I use this IF formula to determine a comparison of two adjacent cells first to see if they are blank and second to see if they are the same value (but not blank)
I have this array formula which almost works.
=IF(OR(AK2="",AL2=""),"BothBlank",IF(AK2=AL2,"Same",AK2=AL2))

I am not permitted to change the data so I am looking to see if cells are blank (vs 0) and if not blank are they the same.
example
AK2= John  AL2=John  should return "Same"
AK2= "" AL2= "" should return BothBlank
 however if there is one cell blank and the other one has value it still says both blank.
I think I need to add another argument to return "Mixed" if AK2 <>AL2 however I cant seem to get it right.  I believe that <> is excels version of "does not equal".
0
Comment
Question by:lithocolor
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 23

Expert Comment

by:NBVC
ID: 39946056
I think this should do...

=IF(AND(AK2="",AL2=""),"",IF(AK=AL2,"Same","Mixed"))
0
 
LVL 13

Expert Comment

by:Santosh Gupta
ID: 39946235
Try this

=IF(AND(AK2="John",AL2="John"),"Same",IF(AND(AK2="",AL2=""),"Both Blank",""))
0
 
LVL 12

Accepted Solution

by:
tel2 earned 250 total points
ID: 39946338
Hi lithocolor,
This works for me:
    =IF(AND(AK2="",AL2=""),"BothBlank",IF(AK2=AL2,"Same","Mixed"))

After writing the above, I noticed that it's the same as NBVC's answer, except that:
- He had an 'AK' typo (should have been 'AK2'), and
- Mine returns 'BothBlank' when both cells are blank (as per your spec's), while his returns an empty cell.

Santosh's solution will never return 'Mixed' and will only return 'Same' if both cells contain the name 'John' (i.e. no other words/names).

lithocolor, you are correct about the '<>' operator, and we could use it here for tests like:
    =IF(AK2<>AL2,"Mixed","Same")
but this kind of thing is probably more readable (positive thinking):
    =IF(AK2=AL2,"Same","Mixed")
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question