Sum Nth cell if next cell is empty

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Hi,

see if this helps:


Book1
ABCDEFGH
1123
2#VALUE!255,3625"1"=Oui
3totaltotal
456,4533,6063,304361,141
5156,77221,77130,0013171,50
6-70,00-70,0000,000-5
7-70,00-70,0000,000-5
8
9
10
11
12total13,5951621
13
Sheet1
Cell Formulas
RangeFormula
F12=SUMPRODUCT((MOD(COLUMN(H4:BH4),4)=0)*(H4:BH4=""),(F4:BF4))
 
Upvote 0
Hi,

see if this helps:

ABCDEFGH
1123
2#VALUE!255,3625"1"=Oui
3totaltotal
456,4533,6063,304361,141
5156,77221,77130,0013171,50
6-70,00-70,0000,000-5
7-70,00-70,0000,000-5
8
9
10
11
12total13,5951621
13

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
F12=SUMPRODUCT((MOD(COLUMN(H4:BH4),4)=0)*(H4:BH4=""),(F4:BF4))

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>
Thanks you Jorismoerings

unfortunately the result should be 32

on the line 4 there is three cell one with F4 >36, one J4 >9 and one N4 > 23. The first cell F4 has in H4 "1" so the orange cell is not empty. Then the J4 has nothing in the cell L4 (orange) and the last one N4 has also nothing in orange cell P4. So the sum should work only on J4 and N4 (9+23) = 32

sorry if I explain my self wrong, I work on this since three day and don't sleep much
:LOL:
 
Upvote 0
soooory

it works but it take the negative result, may I use only positive result ? you see the -5 at the end ? without them
 
Upvote 0
something like this. This will only summarize the numbers if they are >0 and the orange cells is empty.


Book1
ABCDEFGH
1123
2#VALUE!255,3625"1"=Oui
3totaltotal
456,4533,6063,304361,141
5156,77221,77130,0013171,50
6-70,00-70,0000,000-5
7-70,00-70,0000,000-5
8
9
10
11
1253,5951621
13
14
Sheet1
Cell Formulas
RangeFormula
F12=SUMPRODUCT((MOD(COLUMN(H4:BH4),4)=0)*(H4:BH4="")*(F4:BF4>=0),(F4:BF4))
 
Last edited:
Upvote 0

Forum statistics

Threads
1,216,031
Messages
6,128,420
Members
449,449
Latest member
Quiet_Nectarine_

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