Can this be solved in excel?

https://preview.redd.it/9vpyfh965ooe1.png?width=839&format=png&auto=webp&s=76f0a494413675e37e28369312c810aee9ae8578

Can this be solved easily through an Excel function? Both questions A and B? Preferably without making a table.