ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   matching cells (https://www.excelbanter.com/excel-programming/435287-matching-cells.html)

deepokerman

matching cells
 
I am looking for a formula that if the cell A1 and A2 match then cell A3 will
be 4
if they do not match then 0

example: A1 has YES and A2 has YES then cell A3 will be 4
IF both cells are blank the A3 would say 4
A1 has YES and A2 has NO then cell A3 will be 0
A1 has NO and A2 has YES then cell A3 will be 0

Is this possible?
Thanks

Patrick Molloy[_2_]

matching cells
 
=IF(A1=A2,4,0)

"deepokerman" wrote:

I am looking for a formula that if the cell A1 and A2 match then cell A3 will
be 4
if they do not match then 0

example: A1 has YES and A2 has YES then cell A3 will be 4
IF both cells are blank the A3 would say 4
A1 has YES and A2 has NO then cell A3 will be 0
A1 has NO and A2 has YES then cell A3 will be 0

Is this possible?
Thanks


Rick Rothstein

matching cells
 
Here is another formula to do what you want (put it in A3)...

=4*(A1=A2)

--
Rick (MVP - Excel)


"deepokerman" wrote in message
...
I am looking for a formula that if the cell A1 and A2 match then cell A3
will
be 4
if they do not match then 0

example: A1 has YES and A2 has YES then cell A3 will be 4
IF both cells are blank the A3 would say 4
A1 has YES and A2 has NO then cell A3 will be 0
A1 has NO and A2 has YES then cell A3 will be 0

Is this possible?
Thanks



deepokerman

matching cells
 
Yes, that worked. But what would i have to do to make cell A4 be 4 if cellS
A1, A2 A3 are the same and have cell A4 be 0 if A1 A2 A3 do not match in any
order?

"Patrick Molloy" wrote:

=IF(A1=A2,4,0)

"deepokerman" wrote:

I am looking for a formula that if the cell A1 and A2 match then cell A3 will
be 4
if they do not match then 0

example: A1 has YES and A2 has YES then cell A3 will be 4
IF both cells are blank the A3 would say 4
A1 has YES and A2 has NO then cell A3 will be 0
A1 has NO and A2 has YES then cell A3 will be 0

Is this possible?
Thanks


p45cal[_167_]

matching cells
 

=if(and(a1=a2,a2=a3),4,0)

or a la Rick:
=4*(AND(A1=A2,A2=A3))

no, I got that wrong:
=4*(A1=A2)*(A3=A3)


--
p45cal

*p45cal*
------------------------------------------------------------------------
p45cal's Profile: http://www.thecodecage.com/forumz/member.php?userid=558
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=146902



All times are GMT +1. The time now is 12:13 PM.

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