nerdalert22
New Member
- Joined
- Apr 19, 2019
- Messages
- 5
I've been racking my brain all day on this one and desperately need someone to swoop in and give me the answer. Data is set up as follows:
[TABLE="width: 228"]
<tbody>[TR]
[TD]SSN[/TD]
[TD]$Dollars[/TD]
[TD]Date[/TD]
[/TR]
[TR]
[TD]123[/TD]
[TD]$10[/TD]
[TD]10/10/2018[/TD]
[/TR]
[TR]
[TD]123[/TD]
[TD]$10[/TD]
[TD]10/12/2018[/TD]
[/TR]
[TR]
[TD]456[/TD]
[TD][/TD]
[TD]10/14/2018[/TD]
[/TR]
[TR]
[TD]456[/TD]
[TD]$20[/TD]
[TD]10/16/2018[/TD]
[/TR]
[TR]
[TD]123[/TD]
[TD][/TD]
[TD]11/10/2018[/TD]
[/TR]
[TR]
[TD]789[/TD]
[TD]$10[/TD]
[TD]11/12/2018[/TD]
[/TR]
[TR]
[TD]1011[/TD]
[TD]$50[/TD]
[TD]11/14/2018[/TD]
[/TR]
[TR]
[TD]789[/TD]
[TD]$10[/TD]
[TD]11/16/2018[/TD]
[/TR]
[TR]
[TD]456[/TD]
[TD]$40[/TD]
[TD]12/10/2018[/TD]
[/TR]
[TR]
[TD]789[/TD]
[TD]$40[/TD]
[TD]12/12/2018[/TD]
[/TR]
[TR]
[TD]1011[/TD]
[TD]$30[/TD]
[TD]12/14/2018[/TD]
[/TR]
[TR]
[TD]789[/TD]
[TD]$40[/TD]
[TD]12/16/2018[/TD]
[/TR]
</tbody>[/TABLE]
I need to dynamically (data will routinely be added to this list) sum the dollars per month for unique ssn (i.e. if a ssn appears twice in a month, only sum it once) - I need to reference the date parameter in the equation so that it is dynamic in that way too (all months of data are in one sheet). So the right answer is this:
Oct-2018 $30
Nov-2018 $60
Dec-2018 $110
I've seen lots of equations like this today, so I tried it create it for my dataset, but it's not giving the right answer
=SUM(IF(FREQUENCY(IF((C2:C13>=G3)*(C2:C13< G4),match(a2:a13,a2:a13,0)),row(a2:a13)-row(a2)+1),b2:b13))
(where G3=10/1/18 and G4=11/1/18), but it is giving me $10 and it should be $30. I am not attached to this equation if it's all wrong! I just need something that works, and I would like to avoid a helper column, and a pivot table is not a solution for me.
THANK YOU FOR ANY HELP EXCEL MASTERS!!
</g4),match(a2:a13,a2:a13,0)),row(a2:a13)-row(a2)+1),b2:b13))
[TABLE="width: 228"]
<tbody>[TR]
[TD]SSN[/TD]
[TD]$Dollars[/TD]
[TD]Date[/TD]
[/TR]
[TR]
[TD]123[/TD]
[TD]$10[/TD]
[TD]10/10/2018[/TD]
[/TR]
[TR]
[TD]123[/TD]
[TD]$10[/TD]
[TD]10/12/2018[/TD]
[/TR]
[TR]
[TD]456[/TD]
[TD][/TD]
[TD]10/14/2018[/TD]
[/TR]
[TR]
[TD]456[/TD]
[TD]$20[/TD]
[TD]10/16/2018[/TD]
[/TR]
[TR]
[TD]123[/TD]
[TD][/TD]
[TD]11/10/2018[/TD]
[/TR]
[TR]
[TD]789[/TD]
[TD]$10[/TD]
[TD]11/12/2018[/TD]
[/TR]
[TR]
[TD]1011[/TD]
[TD]$50[/TD]
[TD]11/14/2018[/TD]
[/TR]
[TR]
[TD]789[/TD]
[TD]$10[/TD]
[TD]11/16/2018[/TD]
[/TR]
[TR]
[TD]456[/TD]
[TD]$40[/TD]
[TD]12/10/2018[/TD]
[/TR]
[TR]
[TD]789[/TD]
[TD]$40[/TD]
[TD]12/12/2018[/TD]
[/TR]
[TR]
[TD]1011[/TD]
[TD]$30[/TD]
[TD]12/14/2018[/TD]
[/TR]
[TR]
[TD]789[/TD]
[TD]$40[/TD]
[TD]12/16/2018[/TD]
[/TR]
</tbody>[/TABLE]
I need to dynamically (data will routinely be added to this list) sum the dollars per month for unique ssn (i.e. if a ssn appears twice in a month, only sum it once) - I need to reference the date parameter in the equation so that it is dynamic in that way too (all months of data are in one sheet). So the right answer is this:
Oct-2018 $30
Nov-2018 $60
Dec-2018 $110
I've seen lots of equations like this today, so I tried it create it for my dataset, but it's not giving the right answer
=SUM(IF(FREQUENCY(IF((C2:C13>=G3)*(C2:C13< G4),match(a2:a13,a2:a13,0)),row(a2:a13)-row(a2)+1),b2:b13))
(where G3=10/1/18 and G4=11/1/18), but it is giving me $10 and it should be $30. I am not attached to this equation if it's all wrong! I just need something that works, and I would like to avoid a helper column, and a pivot table is not a solution for me.
THANK YOU FOR ANY HELP EXCEL MASTERS!!
</g4),match(a2:a13,a2:a13,0)),row(a2:a13)-row(a2)+1),b2:b13))
Last edited by a moderator: