+ Reply to Thread
Results 1 to 3 of 3

IF Function

  1. #1
    ExcelStress
    Guest

    IF Function


    What formula would I use if I want to check 5 different cells and if
    they are all equal then show In Balance , if not equal show Out of
    Balance ?
    Any help would be appreciated .
    I know the formula to use if only comparing 2 cells , but can't figure
    out how to compare more than 2 .

    Thank you !


    --
    ExcelStress

  2. #2
    Registered User
    Join Date
    06-03-2005
    Posts
    31
    Enter this function in a VBA MOdule in the workbook:

    Function Balance(A, B, C, D, E) As String
    'A,B,C,D,E are the references to the cells to be compared
    If (A = B) And (B = C) And (C = D) And (D = E) Then
    Balance = "In Balance"
    Else
    Balance = "Out Balance"
    End If

    End Function

    Then enter the function name in the spreadsheet:
    It will print "In Balance" / "Out Balnace" depending on the values in cells A,B,C,D,E

    If you prefer not to work with VBA enter the following formula in the spreadsheet:

    =IF(AND(F8=F9,F9=F10,F10=F11,F11=F12),"In Balance","Out Balance")

    where:
    F8 --> Is the reference to the first of the 5 cells.
    F12--> Is the reference to the last of the 5 cells

    Let me know if it works...

    Juan Carlos
    Juan Carlos
    Last edited by cscorp; 06-04-2005 at 01:07 PM.

  3. #3
    Nick Hodge
    Guest

    Re: IF Function

    How about

    =IF(COUNTIF($A$1:$E$1,A1)=5,"In Balance", "Not In Balance")

    --
    HTH
    Nick Hodge
    Microsoft MVP - Excel
    Southampton, England
    [email protected]HIS


    "ExcelStress" <[email protected]> wrote in
    message news:[email protected]...
    >
    > What formula would I use if I want to check 5 different cells and if
    > they are all equal then show In Balance , if not equal show Out of
    > Balance ?
    > Any help would be appreciated .
    > I know the formula to use if only comparing 2 cells , but can't figure
    > out how to compare more than 2 .
    >
    > Thank you !
    >
    >
    > --
    > ExcelStress




+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Bookmarks

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