Let's start by looking at the denary (i.e. base 10) number system. In base 10, you have a column for each digit in a number.
For example, with the number 5,867 you have a 5 in the 1,000's column, an 8 in the 100's column, a 6 in the 10's column, and a 7 in the 1's column. Essentially, this means: (5 x 1,000) + (8 x 100) + (6 x 10) + (7 x 1), which of course comes to 5,867.
The same principle can be used for hexadecimal to denary conversion. Hexadecimal uses the base 16 number system, so instead of have a column for 1's (100), 10's (101), 100's (102) etc. you have a column for 160, 161, 162 etc.
Hexadecimal uses numbers from 0-9 followed by A-F (i.e. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F) to represent their denary equivalent 0-15. The letter A represents 10, B represents 11, and so on up to F which represents 15.
So, for the hexadecimal value A7, we have a 7 in the 160 column, and an A (which as we know represents 10) in the 161 column. Therefore, to convert it to denary, we do:
A7 = (161 x 10) + (160 x 7)
= (16 x 10) + (1 x 7)
= (160) + (7)
= 167
Therefore, the hexadecimal number A7 is equal to the denary number 167.