Scan Column and Create Value in Adjacent Cell

slinger52

New Member
Joined
Nov 22, 2016
Messages
2
Trying to have excel scan down a column of dates and insert a value that corresponds to a changing date. As the column is scanned if there are duplicates a value of 2 would be entered in the cell adjacent to the bottom most duplicate cell leaving the the remaining adjacent cells blank. If there is not a duplicate value above then a 1 would be entered in the adjacent cell. Have tried many formulas with no success. Below is an example of the result I am looking for utilizing a snapshot of my data:

2/24/2015
2/24/20152
3/31/2015
3/31/20152
4/29/2015
4/29/20152
4/30/20151
5/29/2015
5/29/20152
6/27/2015
6/27/20152
7/29/2015
7/29/20152
8/28/2015
8/28/20152
9/18/2015
9/18/20152
10/13/2015
10/13/20152
11/9/2015
11/9/20152
2/13/20151
3/13/20151
4/10/20151
4/25/20151
5/30/20151
6/26/20151
7/24/20151
8/21/20151
9/20/20151
10/16/20151
11/13/20151
12/23/20151
2/14/20151
3/12/20151
2/5/20151
3/2/20151
4/22/20151
5/18/20151
6/15/20151
7/14/20151
8/4/20151
9/2/20151
10/5/20151
10/29/20151
11/17/20151
12/22/20151
7/11/20151
8/11/20151
9/13/20151
10/14/20151
11/9/20151
12/4/20151
2/20/2015
2/20/20152
3/7/20151

<tbody>
</tbody>


Any and all help would be greatly appreciated!!!
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Assuming that is starting in row 1, column A.

In B1:
=IF(COUNTIF(A:A,A1)>1,IF(COUNTIF(A:A,A1)=COUNTIF($A$1:A1,A1),2,""),1)

Copy down.
 
Upvote 0

Unknown
AB
1DateResult
202/24/2015 
302/24/20152
403/31/2015
503/31/20152
604/29/2015
704/29/20152
804/30/20151
905/29/2015
1005/29/20152
1106/27/2015
1206/27/20152
1307/29/2015
1407/29/20152
1508/28/2015
1608/28/20152
1709/18/2015
1809/18/20152
1910/13/2015
2010/13/20152
2111/09/2015
2211/09/20152
2302/13/20151
2403/13/20151
2504/10/20151
2604/25/20151
2705/30/20151
2806/26/20151
2907/24/20151
3008/21/20151
3109/20/20151
3210/16/20151
3311/13/20151
3412/23/20151
3502/14/20151
3603/12/20151
3702/05/20151
3803/02/20151
3904/22/20151
4005/18/20151
4106/15/20151
4207/14/20151
4308/04/20151
4409/02/20151
4510/05/20151
4610/29/20151
4711/17/20151
4812/22/20151
4907/11/20151
5008/11/20151
5109/13/20151
5210/14/20151
5311/09/20151
5412/04/20151
5502/20/2015
5602/20/20152
5703/07/20151
Sheet9
Cell Formulas
RangeFormula
B2=IF(A2=A3,"",COUNTIF(INDEX(A$2:A2,LOOKUP(1,MATCH(A$2:A2,A2,0),ROW(A$2:A2)-ROW($A$2)+1)-1):A2,A2))
 
Upvote 0
This does produce a positive result within the sample data, however when applied to the full data set it adds the number of occurrences of the date up. For example once the date 02/24/2015 appears again in the column it then inserts a 3 instead of a 1 or 2? Any thoughts? Thanks so much...

Unknown
AB
1DateResult
202/24/2015
302/24/20152
403/31/2015
503/31/20152
604/29/2015
704/29/20152
804/30/20151
905/29/2015
1005/29/20152
1106/27/2015
1206/27/20152
1307/29/2015
1407/29/20152
1508/28/2015
1608/28/20152
1709/18/2015
1809/18/20152
1910/13/2015
2010/13/20152
2111/09/2015
2211/09/20152
2302/13/20151
2403/13/20151
2504/10/20151
2604/25/20151
2705/30/20151
2806/26/20151
2907/24/20151
3008/21/20151
3109/20/20151
3210/16/20151
3311/13/20151
3412/23/20151
3502/14/20151
3603/12/20151
3702/05/20151
3803/02/20151
3904/22/20151
4005/18/20151
4106/15/20151
4207/14/20151
4308/04/20151
4409/02/20151
4510/05/20151
4610/29/20151
4711/17/20151
4812/22/20151
4907/11/20151
5008/11/20151
5109/13/20151
5210/14/20151
5311/09/20151
5412/04/20151
5502/20/2015
5602/20/20152
5703/07/20151

<tbody>
</tbody>
Sheet9

Worksheet Formulas
CellFormula
B2=IF(A2=A3,"",COUNTIF(INDEX(A$2:A2,LOOKUP(1,MATCH(A$2:A2,A2,0),ROW(A$2:A2)-ROW($A$2)+1)-1):A2,A2))

<tbody>
</tbody>

<tbody>
</tbody>
 
Upvote 0
The formula I posted doesn't do that. How did it not work for you?
 
Upvote 0
Try this:
Code:
[COLOR=#333333]=IF([/COLOR][COLOR=#0000FF]A2=A3,"",IF(COUNTIF([COLOR=#FF0000]INDEX([COLOR=#00FF00]A$2:A2,LOOKUP([COLOR=#800080]1,MATCH([COLOR=#008080]A$2:A2,A2,0[/COLOR]),ROW([COLOR=#008080]A$2:A2[/COLOR])-ROW([COLOR=#008080]$A$2[/COLOR])+1[/COLOR])-1[/COLOR]):A2,A2[/COLOR])>1,2,1)[/COLOR][COLOR=#333333])[/COLOR]
 
Upvote 0

Forum statistics

Threads
1,214,988
Messages
6,122,620
Members
449,092
Latest member
amyap

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