Excel 2010.
I have a Table structured in this manner:
<code style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; white-space: inherit; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;"></code>[TABLE="class: outer_border, width: 500, align: center"]
<tbody>[TR]
[TD="align: center"]City[/TD]
[TD="align: center"]Region[/TD]
[TD="align: center"]Date[/TD]
[TD="align: center"]Value[/TD]
[/TR]
[TR]
[TD="align: center"]ABC[/TD]
[TD="align: center"]123[/TD]
[TD="align: center"]JAN1[/TD]
[TD="align: center"]10%[/TD]
[/TR]
[TR]
[TD="align: center"]DEF[/TD]
[TD="align: center"]987[/TD]
[TD="align: center"]FEB1[/TD]
[TD="align: center"]7%[/TD]
[/TR]
</tbody>[/TABLE]
</code>The table is fed by user-entry, but there is an important rule:
E.g., Region 123 can't have two values, whether different or the same, for January 1st.
To control this, I utilize two formulas:
I am having trouble with #1. #2 I have tested to work fine, and I know it works.
My attempt was to create this named range, simply called UniqueDates.
I have experimented with trying different criteria combinations, but cannot seem to create a list of unique dates that have been entered thus far. Instead, I get either the wrong dates, or non-distinct results.
It is important to note that the result of this formula is not stored in Data Validation. I use the named range directly in the conditional formatting rule.
I have a Table structured in this manner:
<code style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; white-space: inherit; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;"></code>[TABLE="class: outer_border, width: 500, align: center"]
<tbody>[TR]
[TD="align: center"]City[/TD]
[TD="align: center"]Region[/TD]
[TD="align: center"]Date[/TD]
[TD="align: center"]Value[/TD]
[/TR]
[TR]
[TD="align: center"]ABC[/TD]
[TD="align: center"]123[/TD]
[TD="align: center"]JAN1[/TD]
[TD="align: center"]10%[/TD]
[/TR]
[TR]
[TD="align: center"]DEF[/TD]
[TD="align: center"]987[/TD]
[TD="align: center"]FEB1[/TD]
[TD="align: center"]7%[/TD]
[/TR]
</tbody>[/TABLE]
<code style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; white-space: inherit; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;">(arbitrary values, of course)</code>
<code style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; white-space: inherit; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;"></code>The table is fed by user-entry, but there is an important rule:
- No region can have more than one of the same date, even if the values are different.
E.g., Region 123 can't have two values, whether different or the same, for January 1st.
To control this, I utilize two formulas:
- A Dynamic Named Range that creates a list of unique dates.
- A conditional formatting rule that flags entries that have duplicate dates.
I am having trouble with #1. #2 I have tested to work fine, and I know it works.
My attempt was to create this named range, simply called UniqueDates.
Code:
<code style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; white-space: inherit; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;">=OFFSET(OFFSET(Table!$C$9,0,0,1,1),MATCH(0,COUNTIF(Table[@Region],Entry[Region]),0)-1,0,SUM(COUNTIFS(Table[Region],Entry[@Region])))</code>
I have experimented with trying different criteria combinations, but cannot seem to create a list of unique dates that have been entered thus far. Instead, I get either the wrong dates, or non-distinct results.
It is important to note that the result of this formula is not stored in Data Validation. I use the named range directly in the conditional formatting rule.