I need some clarification.
You have the amount per meal in Column D based on the code F, N or R in column C, but you say that you put 1 in column D, please clarify.
Which columns contain the dates for the month
Which column(s) contains the deposit.
You have a lot of pairs of columns that are multiplied together :
What do these pairs of cells contain, and what is in the 'missing' column between each pair (H & K in the sample above).
Here are some sample formulas
If the student on row 2 has name in A2, F/N/R in C2 and a value (0/0.4/2.5) in D2 and then 1 or blank in say 20 daily cells from F2 to Y2,
the following formula in Z2 will count the number of meals taken:
and the total cost for that student for the 20 days at the rate specified in D2: is calculated by this formula in AA2:
A further formula subtracting the total cost from the deposit will yield the balance.
To get monthly statistics:
In cells AD2 to AD4 enter F, N and R
In cells AE2 to AE4 are formulas to calculate the totals for each meal charge.
My sample spreadsheet had 1s or blanks for 12 students in rows 2 to 13
1 Type #
2 F 54
3 N 50
4 R 52
5 Total 156
In cell AE2 enter this formula:
Then place the cursor inside the formula in the formula bar and press Ctrl+Shift+Enter keys together.
If you get this right the formula will be surrounded by curly braces:
Note: you cannot enter the curly braces from the keyboard.
Note the $ signs in the formula
Then drag the formula down two further rows.
Add Total underneath column AE
The formula in curly braces, entered with Ctrl+Shift+Enter is known as an array formula.