[EASY, SUM=array] Took too long to find this solution and I know it sucks please help

George_Martin_3

New Member
Joined
Sep 12, 2015
Messages
20
Gosh I want to be more efficient and I am trying.

I had no idea how to turn the sum of the row(s) into a boolean statement. Otherwise I'd of used sum_product.

My next trick would then be to add this to an aggregate function in order to evaluate order quantities that can filled up to available units assigned criteria.

=IF(SUM($B$4:B4)<=$B$1,B4,IF(0<(B4-ABS($B$1-SUM($B$4:B4))),B4-ABS($B$1-SUM($B$4:B4)),0))

6vGH0Y9.png

Imgur: The most awesome images on the Internet

B1=27
B4:B11={8,8,8,8,8,8,8,8}

For the life of me I have no idea why I could not google anything close to answer I've generated.
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"

<tbody>
[TD="bgcolor: #909090"] I HAVE MONEY FOR YOU! =
[/TD]
[TD="bgcolor: #909090"] 27
[/TD]
[TD="bgcolor: #909090"] DOLLARS!
[/TD]
[TD="bgcolor: #909090"]

[/TD]
[TD="bgcolor: #909090"]

[/TD]

[TD="bgcolor: #909090, colspan: 2"] EVERY TIME YOU SAW ME YOU ASKED FOR MONEY, WTF? AND LIKE A GOOD FRIEND I GAVE IT TO YOU.
[/TD]
[TD="bgcolor: #909090"]
[/TD]
[TD="bgcolor: #909090"]

[/TD]
[TD="bgcolor: #909090"]

[/TD]

[TD="bgcolor: #909090"]

[/TD]
[TD="bgcolor: #909090"] U ASKED FOR
[/TD]
[TD="bgcolor: #909090"] I GAVE YOU
[/TD]
[TD="bgcolor: #909090"]

[/TD]
[TD="bgcolor: #909090"]

[/TD]

[TD="bgcolor: #909090"] MONDAY
[/TD]
[TD="bgcolor: #909090"] 4
[/TD]
[TD="bgcolor: #909090"] 4
[/TD]
[TD="bgcolor: #909090"]

[/TD]
[TD="bgcolor: #909090"]

[/TD]

[TD="bgcolor: #909090"] TUESDAY
[/TD]
[TD="bgcolor: #909090"] 4
[/TD]
[TD="bgcolor: #909090"] 4
[/TD]
[TD="bgcolor: #909090"]

[/TD]
[TD="bgcolor: #909090"]

[/TD]

[TD="bgcolor: #909090"] WEDNESDAY
[/TD]
[TD="bgcolor: #909090"] 4
[/TD]
[TD="bgcolor: #909090"] 4
[/TD]
[TD="bgcolor: #909090"]

[/TD]
[TD="bgcolor: #909090"]

[/TD]

[TD="bgcolor: #909090"] THURSDAY
[/TD]
[TD="bgcolor: #909090"] 4
[/TD]
[TD="bgcolor: #909090"] 4
[/TD]
[TD="bgcolor: #909090"]

[/TD]
[TD="bgcolor: #909090"]

[/TD]

[TD="bgcolor: #909090"] FRIDAY
[/TD]
[TD="bgcolor: #909090"] 4
[/TD]
[TD="bgcolor: #909090"] 4
[/TD]
[TD="bgcolor: #909090"]

[/TD]
[TD="bgcolor: #909090"]

[/TD]

[TD="bgcolor: #909090"] SATURDAY
[/TD]
[TD="bgcolor: #909090"] 4
[/TD]
[TD="bgcolor: #909090"] 4
[/TD]
[TD="bgcolor: #909090"]

[/TD]
[TD="bgcolor: #909090"]

[/TD]

[TD="bgcolor: #909090"] SUNDAY
[/TD]
[TD="bgcolor: #909090"] 4
[/TD]
[TD="bgcolor: #909090"] 3
[/TD]
[TD="bgcolor: #909090"]

[/TD]
[TD="bgcolor: #909090"]

[/TD]

[TD="bgcolor: #909090"]

[/TD]
[TD="bgcolor: #909090"] 4
[/TD]
[TD="bgcolor: #909090"] 0
[/TD]
[TD="bgcolor: #909090"]

[/TD]
[TD="bgcolor: #909090"]

[/TD]

</tbody>

Cell C4 down =IF(SUM($B$4:B4)<=$B$1,B4,IF(0<(B4-ABS($B$1-SUM($B$4:B4))),B4-ABS($B$1-SUM($B$4:B4)),0))

Thank you.
 
Upvote 0
Would it be this, copied down?

Excel Workbook
BC
127DOLLARS!
2
3U ASKED FORI GAVE YOU
444
544
644
744
844
944
1043
1140
12
Sheet5
 
Upvote 0
No sorry friend it is not. Basically it is how many of a fixed value can I match for values less than the fixed one for every Nth instance. I have 4 dollars, first time you ask for 2, I give you two, next time you ask for 5, I give you three. How much for every Nth instance.
 
Upvote 0
No sorry friend it is not. Basically it is how many of a fixed value can I match for values less than the fixed one for every Nth instance. I have 4 dollars, first time you ask for 2, I give you two, next time you ask for 5, I give you three. How much for every Nth instance.
Sorry, I don't understand that.
Can you give further sample data AND expected output and explain why that output is expected.
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,849
Members
452,361
Latest member
d3ad3y3

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