Suppose your number is on cell A2 then use the formula IF(A2=0,0,MOD(A2-1,9)+1)
This will return the sum of all digits into a single digit between 0 to 9