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

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

Forum statistics

Threads
1,216,116
Messages
6,128,929
Members
449,479
Latest member
nana abanyin

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