So I am trying to come up with a ranking system that will start at 1, and increment for every different client we have, and reseting each month. Heres what I have:

=SUMPRODUCT(--([Client]=[@[Client]]), --([Receive Date]> [@[Receive Date]]) )+1

When this is entered, a #VALUE is returned to the cell, however, when I use

=SUMPRODUCT(--([Client]=[@[Client]]), --([Sales Rep]> [@[Sales Rep]]) )+1

Or another column (that is not a date) everything seems to work out fine. Although, obviously, that makes the ranking on a rep by rep and client basis rather than month.

Any suggestions as to why the date column isn't working and how to fix it?

Edit: Oops, forgot to include this, since I want to reset the ranking every month, I have another column that concatenates the month and year, so a Receive Date of 3/10/2014 would become "3 2014".

Then I use the:

=SUMPRODUCT(--([Client]=[@[Client]]), --([Concat Date]> [@[Concat Date]]) )+1

And thats where things get squirrelly.

Edit 2: Alright, so I think I figured out the formula, which I constructed in this dummy workbook. Everything works perfectly here! But when I copy and paste it into the actual workbook I'm using, the #VALUE error pops up. I've checked the formatting of each corresponding column from my test file to my real one. Has me totally stumped, thoughts?

有帮助吗?

解决方案

Now that you added in the edit of Concat Date, it makes sense... My belief is that you probably are creating that field as text rather than a date and so your comparison operatir will no longer work.

So, suppose your sheet had your dates in column A beginning in A2 - You could create the Concat Date field using the following formula:

=DATE(YEAR(A2),MONTH(A2),1)

OR

=EOMONTH(A2,-1)+1

In effect, it will give you the first day of the month for any date BUT it will still be a date, so your comparison operator will still work.

PS - You can still use cell formatting to make it look like `3 20141 if you really wanted to, but the most important part is that it is a date value so you can use it for comparisons!!

Hope this does the trick!!

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top