Using Range operator (:) In If condition

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an excel sheet, which provided by client, In that one cell contains
formula as follows:
=IF((P42:Q42)=(P43:Q43),"In Balance","Out of Balance")

As per the above formula, My understanding is, P42 should be equal to P43
and Q42 should be equal to Q43, then I will get "In Balance" as output. When
I tried to changes the values in the cells, it is not giving "Out of Balance"
and always showing "In balance" as output. Could you please suggest me on
this.
 
=IF(AND(P42=P43,Q42=Q43),"In Balance","Out of Balance")

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
Difficult as you are trying to compare 2 ranges. I would have thought
an array formula exists for this, however arrays are not my specialty.
You colud always just have the following:
Cell P44:
=P42=P43
Cell Q44:
=Q42=P43
Cell R44:
=IF(AND(P44, R44), "In Balance","Out of Balance")

Hope this helps.

Giff
 
This formula will only compare P42 with P43

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

|I have an excel sheet, which provided by client, In that one cell contains
| formula as follows:
| =IF((P42:Q42)=(P43:Q43),"In Balance","Out of Balance")
|
| As per the above formula, My understanding is, P42 should be equal to P43
| and Q42 should be equal to Q43, then I will get "In Balance" as output. When
| I tried to changes the values in the cells, it is not giving "Out of Balance"
| and always showing "In balance" as output. Could you please suggest me on
| this.
 
Thanks Niek, It is checking 'P' column only and it is not checking 'Q' column
as you said. When I tried by entering value '10' in A1 and A2 and value '20'
in B1 and B2, and used the same formula as follows

=IF((A1:B1)=(A2:B2),"In Balance","Out of Balance")

It is checking for columns 'B' and it is not checking for column 'A'. Is
there any ides, on what basis the formula is deciding the columns, or the
formula which I am using is wrong.

Thanks in Advance,
Soundar.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top