# Microsoft Office Application Help - Excel Help forum > Excel Formulas & Functions >  >  If Cells are Duplicate, then Return a Value

## Ocean Zhang

Is there a formula I can use in B2 whereby if the value in A2 is identical to the value in any other cell in column A, then return the value "duplicate" in B2?

----------


## NBVC

TRy

=if(Countif(A:A,A2)>1,"Duplicate","")

----------


## Ocean Zhang

wow, perfect. Thanks!

----------


## lizc217

i need help with a formula.

column A has my order numbers. If I have duplicate order numbers I need in column B to return value from a plus a -1 , -2 , -3 if there are 3 duplicate orders. if nothing is duplicate just return the same number from A.

here is an example

ColumnA      ColumnB
1853-583     1853-583
1854-581     1854-581-1
1854-581     1854-581-2
1922-252     1922-252-1
1922-252     1922-252-2
1922-252     1922-252-3

Please help

----------


## NBVC

Start a new thread please

----------


## ronaldros05

I want a formula that can decide the trip of a vehicle if it is repeated 2 times in a day

----------


## Glenn Kennedy

Please do not hijack an old thread!!  (See rule 4).  Start your own.  And, to get a quick answer:



Will you please attach a SMALL sample Excel workbook (10-20 rows of data is usually enough)?  However, please give us an indication of the approximate number of rows of data you want the solution to work with (100, 1000, 100,000 or whatever).  Please don't attach a picture of an Excel sheet (no-one will want to re-type all your stuff before starting).

1.  It does NOT have to be your real sheet - mock up a SAMPLE if you need to.  But not 1000's of rows!!! It makes manual checking so tedious.  Whatever you do... make sure that all confidential information is removed first!!

2.  Make sure that your sample data are truly REPRESENTATIVE of your real data.  The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

3.  Make sure that your desired solution is also shown (mock up the results manually).

4.  Try to avoid using merged cells.  They cause lots of problems!

Unfortunately the attachment icon doesn't work at the moment.  So, to attach an Excel file you have to do the following:  Just before posting, scroll down to *Go Advanced*  and then scroll down to *Manage Attachments*.  Now follow the instructions at the top of that screen.

----------

