IF Function

E

ExcelStress

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

Thank you
 
C

cscorp

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 i
cells A,B,C,D,E

Juan Carlo
 
Top