Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 7 of 7

Thread: IF Command

  1. #1
    Guest

    Default

    I am need of the "IF", however, instead of comparing "True" and "False", I need it to compare to cells and see if thier value is the same. Is this possible?

    Thanks,
    Eric

  2. #2
    MrExcel MVP Anne Troy's Avatar
    Join Date
    Feb 2002
    Location
    Westwood NJ
    Posts
    2,582
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Sure, but what do you want it to return? If they're both the same, then it's true, if not, then it's false.

    But you could have it say Yes or No instead.

    Like this:

    =if(a1=b1,"Yes","No")

    or

    =if(a1<>b1,a1,b1*2) a sample if statement.

  3. #3
    Guest

    Default

    What I have is this. If Cell A and B are the same value, then cell C (with the formula in it) would be value X, if cell A and B are different values, then cell C would be X+10)

    The Values of cell's A and B are derived from VLOOKUP statements.

  4. #4
    MrExcel MVP Anne Troy's Avatar
    Join Date
    Feb 2002
    Location
    Westwood NJ
    Posts
    2,582
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    =if(a1=b1,X,X*10)


    ~Anne Troy

  5. #5
    Board Regular
    Join Date
    Feb 2002
    Posts
    202
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    or =IF(EXACT(A1,B1),X,(X+10))

  6. #6
    Guest

    Default

    What's the difference between A1=B1 and Exact(A1,B1)?

  7. #7
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Sunny, spring-like Hull
    Posts
    3,339
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    EXACT is case-sensitive. If you have 'text' and 'Text' in cells A1 and B1 and in C1 you enter the formula (A1=B1), C1 will show True, if you enter EXACT(A1,B1), C1 will show False. It isn't needed in your case, if you're dealing with numbers, but it's a good tip for future use.

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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