Welcome to the forum
As a new member you may not yet have got around to reading the informative forum FAQ which you will find here
Can I ask about my homework here?
Please don't ask us questions directly out of your coursework materials. We are happy to provide direction and guidance for those studying VBA and other software. Be open about the fact that it is coursework, and you'll likely find yourself with more resources than you could possible need.
You were open but we do not really want to wade through old exam questions - it reminds us too much of being at school! And soaks up too much time. So in future, try to summarise the key points to help us quickly identify what you need which I think comes down to the following
The average for days should be reported with a number with two significant digits and the average for amount should be displayed as currency with two significant digits...
....
I created the user form and have all of the options on it. I just don't know how to get it to calculate an average based on the options selected.
You could have just asked:
Can anyone help me write some vba to calculate an average for both a range with cell values with number of days and $amounts to 2 significant digits
To which my reply is:
to try the attached macro
put some values for days in sheet 1 cells B2 to B7
put some values for amounts in sheet 1 cells C2 to C7
the macro will
calculate the averages and place them in B8 and C8
B8 and C8 are then formatted as required
This should give you a starting point. It gives you the syntax. You will need to modify to make it fit your workbook.
If you need help in making your ranges dynamic etc then start a new thread and try to be concise in you explanation.
Sub Calculate_Averages()
Dim DaysAvg As Double, AmntAvg As Double
AmntAvg = Application.Average(Range("b2:b7"))
DaysAvg = Application.Average(Range("c2:c7"))
Sheets("sheet1").Range("B8") = AmntAvg
Sheets("sheet1").Range("B8").NumberFormat = "0.00"
Sheets("sheet1").Range("C8") = DaysAvg
Sheets("sheet1").Range("C8").NumberFormat = "$#,##0.00"
End Sub