Working with 2 separate data sets (with duplicates) Dataset is unique identified by an ID. There may not be an entry for the timestamp I require. Datasets are quite large, and due to duplicates, can't use vlookup.
Samples:
Table 1:
Device Name|Time Bracket| On/Off?
ID1 |06:20:00 |
ID2 |06:20:00 |
ID3 |06:30:00 |
Table 2:
Device Name |Timestamp |On/Off?
ID1 |06:20:00 |On
ID2 |06:50:00 |Off
ID3 |07:20:00 |Off
What I want to achieve:
I want an if statement to check if: 1) device ID matches AND 2) timestamp matches
If so, return the value of On/Off from Table 2. If not, then I want it to return the value of the cell above it IF it's the same device, otherwise just put "absent" into the cell.
I thought I could do this with some IF statements like so:
=if(HOUR([@[Time Bracket]]) = HOUR(Table13[@[Timestamp Rounded (GMT)]]) and
minute([@[Time Bracket]]) = minute(Table13[@[Timestamp Rounded (GMT)]]) and
[@[Device Name]]=Table13[@[Device Name]], Table13[@[On/Off?]],
IF([@[Device Name]]=Table13[@[Device Name]], INDIRECT("B" and Rows()-1), "absent"))
(I put some newlines in there for readability)
However, this doesn't seem to resolve at all... what am I doing wrong? Is this even the correct way of achieving this?
I've also tried something similar with a VLookUp, but that failed horribly.
Thanks all!