Home » excel » linechart – how to get rid of duplicate date in excel line chart?

linechart – how to get rid of duplicate date in excel line chart?

Posted by: admin May 14, 2020 Leave a comment

Questions:

I am using excel track my stock PnL. both 3/1 and 3/2 I have 2 trades. in the line chart, I only want to use the last data of the day.

date   return
3/1/19  2%
3/1/19  1%
3/2/19  3%
3/2/19  4.5%
3/3/19  6%

this is what I want to show on the line chart. how do I do that?

date   return
3/1/19  1%
3/2/19  4.5%
3/3/19  6%
How to&Answers:

Since charts ignore #N/A errors, you can just add another column which produces a #N/A if that date already exists and point your chart to that column instead.

The simple formula, for ordered data, would be something like this

=IF(A2=A3,NA(),B2)

If your data isn’t ordered by date then you can use this formula

=IF(COUNTIF($A$2:A2,A2)=COUNTIF($A$2:$A$6,A2),B2,NA())

This is the setup I was using:

enter image description here