How to solve a issue with three criterias

most

Board Regular
Joined
Feb 22, 2011
Messages
106
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
  2. Mobile
Hi,
I would like some input/pointers on how to solve this, I'm not sure where to begin...
I want to write Active, Not active or Ignore in column E based on three criteria.

As you can see in the table, a person can occur 2-3 times, even 6 times in my orginal data. Data is sorted on column A.

If same employment (column B) occurs two times = all rows should be Ignore.
If employment (column B) differs then check if startdate (column C) and enddate (column D) is within range of "orange date" (B17) then Active else Not active.

/Marcus

ABCDE
1PersonEmploymentStartDateEndDateExpected result
2194505022019-04-242019-11-01Active
3194505012013-06-172019-03-29Not active
4184810022016-01-012019-10-01Ignore
5184810022016-01-012019-10-01Ignore
6175007032019-07-232019-12-31Ignore
7175007022018-01-012019-06-30Ignore
8175007022018-01-012019-06-30Ignore
9166109052019-03-112019-12-31Active
10166109042019-01-012019-03-10Not active
11166109032018-09-102018-12-31Not active
12
13
14
15
16
172019-09-19

<tbody>
</tbody>
 
You have given no logic as to why they should be Ignore.
Ignore is used to point out to the user that those lines need to be double checked, in the final output there should only be one line and one line only per "Person", the idea is that those which are "Ignored" are manually checked and switched to "Active" or "Not Active", the final output should then have one "Active" per "Person".

Row 12
In post 6 you said "EndDate can be blank were expected result should be Active."

Row 13
Post 1 "If employment (column B) differs then check if startdate (column C) and enddate (column D) is within range of "orange date" (B17) then Active"

Rows 14 & 15
Post 1 "If employment (column B) differs then check if startdate (column C) and enddate (column D) is within range of "orange date" (B17) then ... else Not active."
That statement remains, problem with line 12/13 is that both are Active and therefore needs to be checked manually, as in my comment above.
Problem with line 14/15 is that none are Active and therefore needs to be checked manually, as in my comment above.

Further, the condition for Ignore was "If same employment (column B) occurs two times = all rows should be Ignore.". None of rows 12:15 meet that condition.
It was when I first got your help I realized all different scenarios. I believe and hope my first comment in this post explains what I trying to accomplish.
 
Upvote 0

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Ignore is used to point out to the user that those lines need to be double checked,
Sorry, but that sounds completely contradictory to me. Ignore = Please Check ? :unsure:


OK, ignoring the above ..
in the final output there should only be one line and one line only per "Person", ..... the final output should then have one "Active" per "Person".
.. could we add an extra column like this?
If so, it could be added to the code to do it.

Excel Workbook
ABCDEF
1PersonEmploymentStartDateEndDateResultCheck?
219450522019-04-242019-11-01Active 
319450512013-06-172019-03-29Not Active
418481022016-01-012019-10-01IgnoreCheck
518481022016-01-012019-10-01IgnoreCheck
617500732019-07-232019-12-31IgnoreCheck
717500722018-01-012019-06-30IgnoreCheck
817500722018-01-012019-06-30IgnoreCheck
916610952019-03-112019-12-31Active
1016610942019-01-012019-03-10Not Active
1116610932018-09-102018-12-31Not Active
1215610822019-08-01ActiveCheck
1315610812018-12-012019-10-31ActiveCheck
1425611842019-05-062019-08-30Not ActiveCheck
1525611832018-08-202019-05-05Not ActiveCheck
Activity (4)
 
Upvote 0
Yes, that will work. Thanks for all the help!
 
Upvote 0
Yes, that will work. Thanks for all the help!
OK, so if you want the code to do that for you, add the blue section where shown.
Rich (BB code):
  Range("E2").Resize(UBound(a)).Value = Application.Index(a, 0, 5)
  With Range("F2").Resize(UBound(a))
    .Formula = "=IF(COUNTIFS(" & .Offset(, -5).Address & ",A2," & .Offset(, -1).Address & ",""Active"")=1,"""",""Check"")"
    .Value = .Value
  End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,944
Messages
6,122,391
Members
449,080
Latest member
Armadillos

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