A | B | C | D | E |
EmpID | Start Trip Date | End Trip Date | Old Charge | New Charge |
6280 | 1/3/2015 | 5/4/2015 | 12 | 34 |
6293 | 3/3/2015 | 4/4/2015 | 24 | 44 |
6162 | 12/1/2015 | 2/2/2015 | 10 | 22 |
<tbody>
</tbody>
I have a huge 20k row+worksheet that I want to match the EMP ID, compare start date and end date and if they fall into the range on the Trip table, leave the New charge in $E.
A | B | C | D | |||
<tbody> </tbody> |
<tbody> </tbody> | empid | new charge | |||
<tbody> </tbody> |
<tbody> </tbody> |
<tbody> </tbody> | ||||
<tbody> </tbody> |
<tbody> </tbody> |
<tbody> </tbody> | 22 | |||
<tbody> </tbody> |
<tbody> </tbody> |
<tbody> </tbody> |
<tbody>
</tbody>
Only row 2 would fit the criteria and therefore the new charge would appear in that cell.
I thought I could use an IF(and statement with vLookup to find the Emp ID and then compare the date range. vlookup doesnt work. I tried lookup and I cant even get a match which I don't understand, but I know even if lookup worked the rest of the logic doesn't make sense as it may not be on line 2.
my thought something like:
'=IF(AND(LOOKUP($c2,'Trip Table'!$A$2:$A$55,'Trip Table'!$e$2:$e$2000),$A2>='Trip Table'!$a2,'Trip Table!$c2>=$c2),$E2,""))
Probably something like an Hlookup with index match?? if I got that to work I still wouldn't know how to do the date compares.. can anyone help?