Average calculations within userform

coldsteel2177

New Member
Joined
Aug 14, 2018
Messages
1
I am working a a data entry user form that needs to calculate the Days shift Data and the night shift data to create an average. I have 20 averages that needs to be calculated and i have a button set up to execute the averaging function.

Currently the code i am using for the averaging is as follows:
Me.TextBox68.Value = WorksheetFunction.Average(Me.TextBox4.Value, Me.TextBox5.Value)

This works just fine if there is data on both shifts. the issue i am having is that some days there is no data for a certain shift which means one of the two text-boxes being averaged is blank which causes an error. How do i get this to ignore blank boxes.

Any help would be greatly appreciated.
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.

Forum statistics

Threads
1,224,820
Messages
6,181,162
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top