Only five presidents have been elected even though they lost popular vote. John Quincy Adams in 1824, Rutherford Hayes in 1876, Benjamin Harrison in 1888, George W. Bush in 2000, and yes...Donald Trump this November.
Hope this helps, and May the Force Be With You!