Hello,
I hope someone could help to make macro in VBA or code in R.
To better understand what I would like to do in Excel, please imagine that those table are in excel Sheets (Tables below):
There is 3 Sheets:
1. People
2. Data
3. Result
In Sheet “People” I have name of people and number in Row 1. In “Data” sheet we can see records for those people. As you can see one man can have many records with numbers “FROM” “TO”. They cannot have same records or same numbers. If Adam has for 1 to 4 there is no way that next record for Adam would be 3-4, or 4-5, all numbers 1,2,3,4 are blocked in this record.
I need to check if in sheet “People” Adam all numbers in row 1 has included in sheet “Data” but those numbers are in “FROM” – “TO” format and that complicate the task.
“Result” sheet is the final form of this macro. With Y if number in row 1 for Adam exist in sheet “Data” and N if not.
“People”
NAME 2 3 4 5 6
ADAM001
ANNA001
JOHN002
“Data”
NAME FROM TO
ADAM001 1 4
ADAM001 9 15
ADAM001 16 25
ANNA001 10 26
ANNA001 65 85
JOHN002 1 10
“Result”
NAME 2 3 4 5 6
ADAM001 Y Y Y N N
ANNA001 N N N N N
JOHN002 Y Y Y Y Y
Bookmarks