I have a report that I want to vlookup the Dept based on the PCAT. This is where it gets complicated...There are multiple lines on each order and I only want it to bring in the Dept on one line of the order and preferably the lowest line number of the order. I had come up with =IF(COUNTIF(A:A,A2)=1,VLOOKUP(C2,J:K,2,FALSE),IF(B2=1,VLOOKUP(C2,J:K,2,FALSE),"")) which almost works but not every order has a line 1 such as order 1909896-00. Do you have any ideas on how this can be done? My end goal is to do a sumif of miles per dept but I don't want to count the # of miles per order multiple times.