There is another meaning I would like to mention which is “除了/除了…之外”
For instance: Everyone is there but you. 除了你,每个人都在。or除了你之外,每个人都在。
I haven’t told anyone but you. 除了你之外,我没告诉任何人。
As to your second example sentence, you can use this pattern in it,like: 除了一块蛋糕之外,我们吃了所有的(东西)。
The more natural way to say it in mandarin is 我们吃了所有的东西,就剩一块蛋糕。In English, l figure it is: we ate all, just left one slice of cake. I am not sure if this is the most natural way to say it in English,but we prefer to say it just like this.