You may want to look at the LOOKUP function. I belive it is probably what you want to use. Just create a table of all possible combinations you get on the keypad.

Let me explain,

B0+B4 = 1 (PORTB = 00010001)
B0+B5 = 2 (PORTB = 00100001)

etc...

Now you have a 16 unique numbers that represent each keypad character. You can have the 16 numbers in a LOOKDOWN table, so you compare the PORTB number to the table. This gives you the location that matches the number. Now you create a LOOKUP table that contains the keypad characters in the EXACT order as the numbers they represent (as you created them in the LOOKDOWN table). You use the position value from the LOOKDOWN function to select you the desired character in the LOOKUP table.

The following article is probably very useful:
http://www.parallax.com/dl/docs/cols/nv/vol4/col/97.pdf