I'm not sure which language do you use. Because you mentioned spreadsheet I assume that it's something like Excel. In Excel the formula should look like this:
=(CODE(TEXT)-97)*26*26+
(CODE(RIGHT(LEFT(TEXT,2),1))-97)*26+
(CODE(RIGHT(LEFT(TEXT,3),1))-97) +
1
The first line is responsible for the first letter, the second for the second letter and the third for the last letter. In the last line there is +1 because the result would be computed from 0 not 1.