Sum of six columns with certain conditions using if statement

nskatoch

Board Regular
Joined
Dec 30, 2013
Messages
53
Office Version
  1. 365
Platform
  1. Windows
C6​
D6​
E6​
F6​
G6​
H6​
I6​
TOTAL(Sum of Six Columns.
Max. marks
80​
80​
80​
80​
80​
80​
80​
480​
SAN40706050254045
JOHN30354026404522

In the above table, I want Sum of six columns out of seven with the following conditions,
IF (F6<27, SUM(C6,D6,E6,G6,H6,I6),
IF (G6<27, SUM (C6,D6,E6,F6,H6,I6)
IF (H6<27, SUM(C6,D6,E6,F6,G6,I6)
IF (I6<F6, SUM(C6,D6,E6,F6,G6,H6)
IF (I6<G6, SUM(C6,D6,E6,F6,G6,H6)
IF (I6<H6, SUM(C6,D6,E6,F6,G6,H6),
IF (I6<0, SUM(C6,D6,E6,F6,G6,H6).

I have applied the following formula, but it does not fulfil all the above conditions:

=IF(F6<27,SUM(C6,D6,E6,G6,H6,I6),IF(G6<27,SUM(C6,D6,E6,F6,H6,I6),IF(H6<27,SUM(C6,D6,E6,F6,G6,I6),IF(I6<0,SUM(C6,D6,E6,F6,G6,H6),IF(I6<F6,SUM(C6,D6,E6,F6,G6,H6),IF(I6<G6,SUM(C6,D6,E6,F6,G6,H6),IF(I6<H6,SUM(C6,D6,E6,F6,G6,H6),"")))))))
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
What if more than one condition is met? As with the bottom row in your example?
 
Upvote 0
What if more than one condition is met? As with the bottom row in your example?
Sir, I am using MS office 2019.
Result.png
 
Upvote 0
That doesn't answer my question.

As far as I can see your formula will fulfill the conditions that you have specified. If it doesn't then a clearer and more detailed explanation will be needed, not just a screen capture (which is useless to us) with no explanation.
 
Upvote 0
That doesn't answer my question.

As far as I can see your formula will fulfill the conditions that you have specified. If it doesn't then a clearer and more detailed explanation will be needed, not just a screen capture (which is useless to us) with no explanation.
Dear member in the above table, as see the value in col. TOTAL, my formula not fulfil the following conditions:
IF (I6<F6, SUM(C6,D6,E6,F6,G6,H6), the TOTAL should be 249 instead of 247
IF (I6<G6, SUM(C6,D6,E6,F6,G6,H6),the TOTAL should be 265 instead of 264
IF (I6<H6, SUM(C6,D6,E6,F6,G6,H6),the TOTAL should be 316 instead of 311
S1.png

IF (I6<0, SUM(C6,D6,E6,F6,G6,H6), the TOTAL should be 245 instead of 225
 
Upvote 0
Why is Student B 308 rather than 273 as I is less than H?
The same for C as I is less than both F & G, so shouldn't it be 318?
 
Upvote 0
You still haven't answered my question!
What if more than one condition is met?
In the case of this example from your most recent post
IF (I6<F6, SUM(C6,D6,E6,F6,G6,H6), the TOTAL should be 249 instead of 247
F6 is less than 27 so the formula is giving the first condition priority.

By striking out both F and I in your screen capture you are suggesting that both values should be ignored, in which case the correct result would be 224, not 249 as you have told us.
 
Upvote 0
You still haven't answered my question!

In the case of this example from your most recent post

F6 is less than 27 so the formula is giving the first condition priority.

By striking out both F and I in your screen capture you are suggesting that both values should be ignored, in which case the correct result would be 224, not 249 as you have told us.

Dear Members,
In the case of student "E", the value of columns G and I are less than 27, in my formula only first condition is fulfilled i.e. IF(G6<27,SUM(C6,D6,E6,F6,H6,I6), but in the same time the of column "I" is less than then the value of column "G" i.e. IF (I6<G6, SUM(C6,D6,E6,F6,G6,H6) so the second condition not fulfilled.
=IF(F6<27,SUM(C6,D6,E6,G6,H6,I6),IF(G6<27,SUM(C6,D6,E6,F6,H6,I6),IF(H6<27,SUM(C6,D6,E6,F6,G6,I6),IF(I6<0,SUM(C6,D6,E6,F6,G6,H6),IF(I6<F6,SUM(C6,D6,E6,F6,G6,H6),IF(I6<G6,SUM(C6,D6,E6,F6,G6,H6),IF(I6<H6,SUM(C6,D6,E6,F6,G6,H6),"")))))))
And same in case of student named "F" and "G".
I want both conditions should be fulfilled at the same time.
 
Upvote 0

Forum statistics

Threads
1,214,935
Messages
6,122,337
Members
449,077
Latest member
Jocksteriom

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