How to extract list of entries by month & without duplicates.

BigMoe

New Member
Joined
Nov 1, 2014
Messages
18
***I'm using Excel 2003***

I'm working on a spreadsheet to track my stock trading activities for one year. I used the following formula to give me a list of all the stocks traded without duplicates:
=INDEX(D$5:D$4244,MATCH(0,COUNTIF(J$4:J4,D$5:D$4244),-1))

However, I'm having difficulty doing the same for a list of stocks traded by month without any duplicates. Basically, I need help in adding some sort of month component to the above formula, or a completely new formula that will do the trick. Below is a miniature mock-up of that portion of the spreadsheet.

Many thanks in advance.

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD="align: center"]C[/TD]
[TD="align: center"]D[/TD]
[TD="align: center"]E[/TD]
[TD="align: center"]F[/TD]
[/TR]
[TR]
[TD="align: center"]Date Traded[/TD]
[TD="align: center"]Stock Symbols[/TD]
[TD="align: center"]Symbols - Jan[/TD]
[TD="align: center"]Symbols - Feb[/TD]
[/TR]
[TR]
[TD="align: center"]1/1/15[/TD]
[TD="align: center"]AAPL[/TD]
[TD="align: center"]AAPL[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]1/1/15[/TD]
[TD="align: center"]RIG[/TD]
[TD="align: center"]RIG[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]1/1/15[/TD]
[TD="align: center"]XOM[/TD]
[TD="align: center"]XOM[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]1/1/15[/TD]
[TD="align: center"][/TD]
[TD="align: center"]FB[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]1/1/15[/TD]
[TD="align: center"][/TD]
[TD="align: center"]UNH[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]1/2/15[/TD]
[TD="align: center"]FB[/TD]
[TD="align: center"]TWTR[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]1/2/15[/TD]
[TD="align: center"]AAPL[/TD]
[TD="align: center"]VLO[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]1/2/15[/TD]
[TD="align: center"]RIG[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]1/2/15[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]1/2/15[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]1/3/15[/TD]
[TD="align: center"]UNH[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]1/3/15[/TD]
[TD="align: center"]AAPL[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]1/3/15[/TD]
[TD="align: center"]TWTR[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]1/3/15[/TD]
[TD="align: center"]VLO[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]1/3/15[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Maybe Im missing something here, but why not just reference the jan column, instead of the Stock column?
 
Upvote 0
The Jan column is the column I'm asking for help with. I'm just showing the results i would like to have.
 
Last edited:
Upvote 0
kind of complex but maybe with a couple of modifications to the table to just the month abbreviation.

I also believe that with 2003 you need to have the Analysis tool pack add in installed to access the frequency function but I could be mistaken.

Row 1 with the unique count for each month could be hidden if you wanted.

Below is a link to the sheet.

https://app.box.com/s/1bwvvnxz50jhstqrh8axut7si6h9h4gb


Excel 2012[TABLE="class: grid, width: 500"]
<tbody>[TR="bgcolor: #DAE7F5"]
[TH][/TH]
[TH]C[/TH]
[TH]D[/TH]
[TH]E[/TH]
[TH]F[/TH]
[TH]G[/TH]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="align: right"][/TD]
[TD="bgcolor: #FFFF00"]Unique Count[/TD]
[TD="bgcolor: #FFFF00, align: right"]6[/TD]
[TD="bgcolor: #FFFF00, align: right"]1[/TD]
[TD="bgcolor: #FFFF00, align: right"]2[/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD="bgcolor: #FFFF00, align: center"]Date Traded[/TD]
[TD="bgcolor: #FFFF00, align: center"]Stock Symbols[/TD]
[TD="bgcolor: #FFFF00, align: center"]Jan[/TD]
[TD="bgcolor: #FFFF00, align: center"]Feb[/TD]
[TD="bgcolor: #FFFF00, align: center"]Mar[/TD]
[/TR]
[TR]
[TD="align: center"]3[/TD]
[TD="align: center"]1/1/2015[/TD]
[TD="align: center"]AAPL[/TD]
[TD="align: center"]AAPL[/TD]
[TD="align: center"]RIG[/TD]
[TD="align: center"]AAPL[/TD]
[/TR]
[TR]
[TD="align: center"]4[/TD]
[TD="align: center"]1/1/2015[/TD]
[TD="align: center"]RIG[/TD]
[TD="align: center"]RIG[/TD]
[TD="align: center"][/TD]
[TD="align: center"]TWTR[/TD]
[/TR]
[TR]
[TD="align: center"]5[/TD]
[TD="align: center"]1/1/2015[/TD]
[TD="align: center"]XOM[/TD]
[TD="align: center"]XOM[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]6[/TD]
[TD="align: center"]1/1/2015[/TD]
[TD="align: center"][/TD]
[TD="align: center"]FB[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]7[/TD]
[TD="align: center"]1/1/2015[/TD]
[TD="align: center"][/TD]
[TD="align: center"]UNH[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]8[/TD]
[TD="align: center"]1/2/2015[/TD]
[TD="align: center"]FB[/TD]
[TD="align: center"]VLO[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]9[/TD]
[TD="align: center"]3/2/2015[/TD]
[TD="align: center"]AAPL[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]10[/TD]
[TD="align: center"]2/2/2015[/TD]
[TD="align: center"]RIG[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]11[/TD]
[TD="align: center"]1/2/2015[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]12[/TD]
[TD="align: center"]2/2/2015[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]13[/TD]
[TD="align: center"]1/3/2015[/TD]
[TD="align: center"]UNH[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]14[/TD]
[TD="align: center"]3/3/2015[/TD]
[TD="align: center"]AAPL[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]15[/TD]
[TD="align: center"]3/4/2015[/TD]
[TD="align: center"]TWTR[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]16[/TD]
[TD="align: center"]1/3/2015[/TD]
[TD="align: center"]VLO[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]17[/TD]
[TD="align: center"]1/3/2015[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
</tbody>[/TABLE]
Sheet1

[TABLE="width: 85%"]
<tbody>[TR]
[TD]Array Formulas[TABLE="width: 100%"]
<tbody>[TR="bgcolor: #DAE7F5"]
[TH]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]E1[/TH]
[TD="align: left"]{=SUM(IF(FREQUENCY(IF($D$3:$D$17<>"",IF(TEXT($C$3:$C$17,"mmm")=E$2,MATCH($D$3:$D$17,$D$3:$D$17,0))),ROW(C$3:C$17)-ROW(C$3)+1),1))}[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]E3[/TH]
[TD="align: left"]{=IF(ROWS(E$2:E2)>E$1,"",INDEX($D$3:$D$17,SMALL(IF(FREQUENCY(IF($D$3:$D$17<>"",IF(TEXT($C$3:$C$17,"mmm")=E$2,MATCH($D$3:$D$17,$D$3:$D$17,0))),ROW(C$3:C$17)-ROW(C$3)+1),ROW(C$3:C$17)-ROW(C$3)+1),ROWS(E$3:E3))))}[/TD]
[/TR]
</tbody>[/TABLE]
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
Thanks so much Weazel!
You actually also solved my next question with your two formulas. Really appreciate it. :beerchug:
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,849
Members
452,361
Latest member
d3ad3y3

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