ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Add certain cells given specific criteria (https://www.excelbanter.com/excel-worksheet-functions/222471-add-certain-cells-given-specific-criteria.html)

hcronrath

Add certain cells given specific criteria
 
On sheet 1 Column1 is a date function that returns the number of months sales
have come in, it is formatted as a number. On the same sheet in Column 2 I
want to sum the sales from another sheet ('PTD Comp Finney'!).

Sheet 1 Data
Column 1 Column 2
0 =IFERROR('PTD Comp Finney'!D16," ") - This is correct

1 =IFERROR('PTD Comp Finney'!D16," ") - If column 1=1, then I
want to calculate =IFERROR('PTD Comp Finney'!D16:D17," ")

2 =IFERROR('PTD Comp Finney'!D16," ")- If column 1=2, then I
want to calculate =IFERROR('PTD Comp Finney'!D16:D18," ")

3 =IFERROR('PTD Comp Finney'!D16," ")- If column 1=3, then I
want to calculate =IFERROR('PTD Comp Finney'!D16:D19," ")

4 =IFERROR('PTD Comp Finney'!D16," ")- If column 1=4, then I
want to calculate =IFERROR('PTD Comp Finney'!D16:D20," ")

5 =IFERROR('PTD Comp Finney'!D16," ")- If column 1=5, then I
want to calculate =IFERROR('PTD Comp Finney'!D16:D21," ")

and so on...

Any help would be most appreciated.
--
cheers,
Heather

Sheeloo[_3_]

Add certain cells given specific criteria
 
Put this in B1
=IFERROR(SUM(INDIRECT("'PTD Comp Finney'!D16:D"&(16+A1))),"")

By putting appropriate number in A1 (0,1,2,...) you will get the answer you
want in B1

You can also copy this down and get different answers by putting different
numbers in Col A

"hcronrath" wrote:

On sheet 1 Column1 is a date function that returns the number of months sales
have come in, it is formatted as a number. On the same sheet in Column 2 I
want to sum the sales from another sheet ('PTD Comp Finney'!).

Sheet 1 Data
Column 1 Column 2
0 =IFERROR('PTD Comp Finney'!D16," ") - This is correct

1 =IFERROR('PTD Comp Finney'!D16," ") - If column 1=1, then I
want to calculate =IFERROR('PTD Comp Finney'!D16:D17," ")

2 =IFERROR('PTD Comp Finney'!D16," ")- If column 1=2, then I
want to calculate =IFERROR('PTD Comp Finney'!D16:D18," ")

3 =IFERROR('PTD Comp Finney'!D16," ")- If column 1=3, then I
want to calculate =IFERROR('PTD Comp Finney'!D16:D19," ")

4 =IFERROR('PTD Comp Finney'!D16," ")- If column 1=4, then I
want to calculate =IFERROR('PTD Comp Finney'!D16:D20," ")

5 =IFERROR('PTD Comp Finney'!D16," ")- If column 1=5, then I
want to calculate =IFERROR('PTD Comp Finney'!D16:D21," ")

and so on...

Any help would be most appreciated.
--
cheers,
Heather


Pete_UK

Add certain cells given specific criteria
 
I think what you want to do is something like this:

=IFERROR(SUM(INDIRECT("'PTD Comp Finney'!D16:D"&16+A1)),"")

and then copy down.

Hope this helps.

Pete

On Feb 26, 7:35*pm, hcronrath
wrote:
On sheet 1 Column1 is a date function that returns the number of months sales
have come in, it is formatted as a number. *On the same sheet in Column 2 I
want to sum the sales from another sheet ('PTD Comp Finney'!).

Sheet 1 Data
Column 1 *Column 2
0 * * * * * * =IFERROR('PTD Comp Finney'!D16," ") - This is correct

1 * * * * * * =IFERROR('PTD Comp Finney'!D16," ") - If column 1=1, then I
want to calculate *=IFERROR('PTD Comp Finney'!D16:D17," ")

2 * * * * * * =IFERROR('PTD Comp Finney'!D16," ")- If column 1=2, then I
want to calculate *=IFERROR('PTD Comp Finney'!D16:D18," ")

3 * * * * * * =IFERROR('PTD Comp Finney'!D16," ")- If column 1=3, then I
want to calculate *=IFERROR('PTD Comp Finney'!D16:D19," ")

4 * * * * * * =IFERROR('PTD Comp Finney'!D16," ")- If column 1=4, then I
want to calculate *=IFERROR('PTD Comp Finney'!D16:D20," ")

5 * * * * * * =IFERROR('PTD Comp Finney'!D16," ")- If column 1=5, then I
want to calculate *=IFERROR('PTD Comp Finney'!D16:D21," ")

and so on...

Any help would be most appreciated.
--
cheers,
Heather




All times are GMT +1. The time now is 05:29 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com