Geological Model

Hello,

is it possible convert lithology into number? e.g i have a 30m granite from 0m to 30m and i would like to code GRANITE as "1" so that instead of granite it will "1" in new calculation column but the result will be 0-1m=1, 1-2m=1,………29-30=1m?