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

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
say data is in B2 down.

in A2 put

=IF(COUNTIF($B$2:B2,B2)=1,1,0)
 
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,975
Messages
6,122,538
Members
449,088
Latest member
RandomExceller01

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