ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   are these 2 statements equivalent? (https://www.excelbanter.com/excel-programming/380053-these-2-statements-equivalent.html)

Gary Keramidas

are these 2 statements equivalent?
 
=AND(H2=T2,T2=T4,T4=T6,T6=W8,H21=H2)
=AND(H2,T2,T4,T6,W8 =H21)


--


Gary




Dave Peterson

are these 2 statements equivalent?
 
Nope.

Put False in all those cells and look how each formula evaluates.

Gary Keramidas wrote:

=AND(H2=T2,T2=T4,T4=T6,T6=W8,H21=H2)
=AND(H2,T2,T4,T6,W8 =H21)

--

Gary


--

Dave Peterson

Gary Keramidas

are these 2 statements equivalent?
 
ok, is there a shorter way to write the first one?

--


Gary


"Dave Peterson" wrote in message
...
Nope.

Put False in all those cells and look how each formula evaluates.

Gary Keramidas wrote:

=AND(H2=T2,T2=T4,T4=T6,T6=W8,H21=H2)
=AND(H2,T2,T4,T6,W8 =H21)

--

Gary


--

Dave Peterson




Bob O`Bob

are these 2 statements equivalent?
 
Gary Keramidas wrote:
ok, is there a shorter way to write the first one?


this is no shorter, but IMO the intent is much more clear:

=AND(H2=T2,H2=T4,H2=T6,H2=W8,H2=H21)



Bob
--

Ken

are these 2 statements equivalent?
 
Gary

It is a little shorter, and I think a lttle clearer to just go with

=h2=t2=t4=t6=w8=h21

since it looks to me like you want TRUE if those cells are all the same
and FALSE otherwise.

Ken


Gary Keramidas wrote:
=AND(H2=T2,T2=T4,T4=T6,T6=W8,H21=H2)
=AND(H2,T2,T4,T6,W8 =H21)


--


Gary




All times are GMT +1. The time now is 03:30 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com