If you were on the basement 5 and the elevator went up 7 floors, then you are now on the 2nd floor.
In which floor im now?
Imagine a staircase that goes down. The basement is at the bottom of the staircase, and the top floor is at the top. If you start at the basement 5, then you have to go up 5 floors to get to the ground floor. Once you're on the ground floor, you can start going up again.
If you go up 2 more floors, then you will be on the 2nd floor.
This means that basement 5 is equivalent to the negative number -5, if we go 7 floors up we need to add 7, then we will get:
-5 + 7 = 2