probably easy range question...

engine22

Board Regular
hi,

cell Z1=1998

i wanna do the sum of the value starting when my row 2 will equals 1998

ex)
• A - B - C - D - E
row2 = 1997-1998-1999-2000-2001
row3 = 1 1 1 1 1

in row 4 i want to calculate the sum from when row2=>1998 to actual cell

formula in E4 would look like that

=sum(\$"cell when cell in row2=1998":D3)=sum(\$A3:E3)
giving the answer 4 (1+1+1+1)

i hope i was clear enough

i basically just want to put a condition to the first cell in my range...

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple

engine22

Board Regular
=sum(\$"cell when cell in row2=1998":E3)=sum(\$A3:E3)

E3 not D3 sorry in the first sum...

Scott Huish

MrExcel MVP
I'm guessing you mean when 1998 is in Column 2 (B), not row 2, perhaps:

=SUM(INDEX(3:3,MATCH(1998,\$A\$2:\$E\$2,0)):IV3)

engine22

Board Regular
the thing is 1998 ia not always in column B but it is always in row 2

engine22

Board Regular
ur formula almost works...but it give me the sum of the entire row until 1998 and i would like the sum of 1998 until the cell of the row...

therefore if it is before 1998 it would be zero and on 1998 it would be the same answer and after 1998 it would add 1998 + ... + 2000 if i am in the cell 2000

Scott Huish

MrExcel MVP
Not sure what you mean, as you can see in this sample it added everything from 1998 on.
Book8
ABCDE
219961997199819992000
3453118
410
Sheet1

engine22

Board Regular
ill try to explain it better...

i want to compute a range... in my case a sum

however, my range would not always start from the same cell... it will always start from the cell equals to Z1.

if Z1=1998 and i have the following data:

---A----B-----C-----D---
1997-1998-1999-2000
---1----2-----3------4---

i want my formula in E2 to sum all the cell in row 2, starting at 1998

it will give me 2+3+4 = 9

i hope it was more clear this time

Scott Huish

MrExcel MVP
In your first question, your data to sum was in Row 3, now you're saying it's in Row 2. So I'm going to go with Row 2 this time (this would put the years across in row 1):

=SUM(INDEX(2:2,MATCH(\$Z\$1,\$A\$1:\$E\$1,0)):E2)

Replies
19
Views
2K
Replies
2
Views
248
Replies
4
Views
196
Replies
3
Views
922
Replies
4
Views
241

1,181,649
Messages
5,931,217
Members
436,784
Latest member
amuljono

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?

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

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