If (2 numbers in cell are identical) print "1" or "0" in cell "x"

Alnicoll

New Member
Joined
Sep 8, 2014
Messages
3
I can't seem to find an answer to this can anyone advise me please?
I want excel to recognize if column A row 1 has identical numbers (or text), print "1" in column B row 1. Else, print "0".


For instance
A _____________B
3 31
5 90

<tbody>
</tbody>
Thanks
 
Last edited:

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN

Sanjeev1976

Active Member
Joined
Dec 25, 2008
Messages
367
Office Version
  1. 365
Platform
  1. Windows
I can't seem to find an answer to this can anyone advise me please?
I want excel to recognize if column A row 1 has identical numbers (or text), print "1" in column B row 1. Else, print "0".


For instance
A _____________B
3 31
5 90

<tbody>
</tbody>
Thanks

Try =IF(LEFT(A1,1)=RIGHT(A1,1),1,0)
 
Upvote 0

Rick Rothstein

MrExcel MVP
Joined
Apr 18, 2011
Messages
38,154
Office Version
  1. 2019
  2. 2010
Platform
  1. Windows
If you only have two single digits in each of the cells...

=0+(LEFT(A1)=RIGHT(A1))

otherwise...

=0+(LEFT(A1,FIND(" ",A1)-1)=MID(A1,FIND(" ",A1)+1,99))
 
Upvote 0

Forum statistics

Threads
1,195,953
Messages
6,012,515
Members
441,703
Latest member
clivelincoln

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top