Sum values of six textboxes out of 9 textboxes with a condition

kelly mort

Well-known Member
Joined
Apr 10, 2017
Messages
2,169
Office Version
  1. 2016
Platform
  1. Windows
Hello and merry Christmas to you (if you do celebrate it)

I need help with this challenge :

There are these 9 textboxes on my userform that I want to add values from six of them and place the result in the 10th textbox.

Now these are the rules for the summing :

1. Add the first 4 boxes if all first 4 are none empty. Then added the first two smallest values from the rest of the textboxes.
2. If one of the first 4 boxes is empty then add the three none empty ones and add first three smallest values from the remaining textboxes.
3. If two boxes are empty from the first 4 textboxes then add the two none empty and add first 4 smallest values of the rest of the textboxes. This should follow in that order.

I am stacked with the algorithm.

I have the feeling someone here can fix it for me.

Thanks in advance
Kelly
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)

Forum statistics

Threads
1,215,061
Messages
6,122,921
Members
449,094
Latest member
teemeren

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