Formula problem

Bopper29

New Member
Joined
Apr 5, 2007
Messages
11

Book1
ABCDE
10.511.5Total
21951416.5
324419120.5
4666
54314.5
Sheet1


Above is a sample of a spreadsheet I have constructed.

Everything I need is working fine except the Total column. I have tried various formulas but struggled to find the correct solution to give me the answer I require.

Basically the total column is a sum of the first 20 results in column B,C & D using the multiplier in row 1.
Order of preference is column D first followed by C followed by B. Row 3 for example only column D and C are to be used in the total calculation.

Any help would be greatly appreciated
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
How about
=IF(D2="",C2*C$1+B2*B$1,IF(C2="",D2*D$1+B2*B$1,D2*D$1+C2*C$1))
 
Upvote 0
Close. But it calculates all values in columns B.C & D should only take the first 20 working in reverse.

EG Row 3 just columns C & D. B should be ignored
 
Upvote 0
I don't understand what you are saying.
The formula I supplied gives the results that you have shown.
 
Upvote 0
Perhaps this?

=IF(SUM(B2:D2)<=20,D2*D$1+C2*C$1+B2*B$1,IF(SUM(C2:D2)<=20,D2*D$1+C2*C$1,D2*D$1))


Close. But it calculates all values in columns B.C & D should only take the first 20 working in reverse.

EG Row 3 just columns C & D. B should be ignored

A question then, what is D = 15 and C = 7.

Do you calculate only D or do you calculate D and 5 from C?
 
Last edited:
Upvote 0
I don't understand what you are saying.
The formula I supplied gives the results that you have shown.

I have another part of the sheet which has 0 in B, 3 in C and 23 in D. The correct result should be 30 your formula give 37.5
 
Upvote 0
I have another part of the sheet which has 0 in B, 3 in C and 23 in D. The correct result should be 30 your formula give 37.5

Then mine will not work either. Based on that, it returns 34.5.
 
Upvote 0
Try this:

=IF(D2>20,20*D$1,IF(C2+D2>20,D2*D$1+(20-D2)*C$1,IF(B2+C2+D2>20,D2*D$1+C2*C$1+(20-C2-D2)*B$1,D2*D$1+C2*C$1+B2*B$1)))
 
Upvote 0

Forum statistics

Threads
1,223,907
Messages
6,175,300
Members
452,633
Latest member
DougMo

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