Formula to identify first value with 1, others with 0

braddewhat

New Member
Joined
Sep 16, 2016
Messages
3
I need to add a column to count the number of orders. Report is sorted by order number.

For the first instance of the order, I need a value of 1. For lines with the same order number, I need a 0. Having the 1 or 0 will allow me to count the unique orders and display on a pivot table.
Capture.jpg
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
say data is in B2 down.

in A2 put

=IF(COUNTIF($B$2:B2,B2)=1,1,0)
 
Upvote 0
Report is sorted by order number.

Hi, if that's the case this might be sufficient and efficient.


Excel 2013
AB
1Order #Formula
211
310
410
521
620
731
830
930
1041
1140
1240
1340
1451
1550
1661
1760
1860
Sheet1
Cell Formulas
RangeFormula
B2=IF(A2=A1,0,1)
 
Upvote 0
Happy holidays:

I assumed your tracking column is A.
The first order will always be the first unique so A1 = 1 shouldn't cause any problems
All subsequent rows (I assumed 1000 rows) should examine column B on same row and compare it to B on previous row.

A1 =1
A2:A1000 = if(b2=b1,0,1)
 
Upvote 0

Forum statistics

Threads
1,214,875
Messages
6,122,037
Members
449,062
Latest member
mike575

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
Back
Top