ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How to get SUM of range of cells based on two separate dropdown selections. (https://www.excelbanter.com/excel-discussion-misc-queries/446008-how-get-sum-range-cells-based-two-separate-dropdown-selections.html)

Bretai2k

How to get SUM of range of cells based on two separate dropdown selections.
 
I have 2 dropdowns (A2 and B2) on sheet 1 that both reference cells B2 through B75 on sheet 2. I want to be able to do a SUM of all cells in the B column of sheet 2 between what I select in dropdowns A2 and B2.

I can provide examples if this is not clear enough.

TIA

Mazzaropi

Quote:

Originally Posted by Bretai2k (Post 1601615)
I have 2 dropdowns (A2 and B2) on sheet 1 that both reference cells B2 through B75 on sheet 2. I want to be able to do a SUM of all cells in the B column of sheet 2 between what I select in dropdowns A2 and B2.
I can provide examples if this is not clear enough.
TIA

<<<<< HELP from BRAZIL

Dear Bretai2k, Good Afternoon.

Take a look at it and tell me if it worked for you.

=SUM(INDIRECT(CONCATENATE("Plan2!$B",MATCH(A2,Plan 2!$B$2:$B$75,0)+1,":$B",MATCH(B2,Plan2!$B$2:$B$75, 0)+1)))

Fell free to ask anything about your question.
Have a nice day.

Bretai2k

Quote:

Originally Posted by Mazzaropi (Post 1601619)
<<<<< HELP from BRAZIL

Dear Bretai2k, Good Afternoon.

Take a look at it and tell me if it worked for you.

=SUM(INDIRECT(CONCATENATE("Plan2!$B",MATCH(A2,Plan 2!$B$2:$B$75,0)+1,":$B",MATCH(B2,Plan2!$B$2:$B$75, 0)+1)))

Fell free to ask anything about your question.
Have a nice day.

Concatenate might be what I am looking for, but I'm trying to understand what the Plan2 are referencing. When I plug it in, it asks me to update values and then I get #N/A? for the two Plan2s that are referenced after the MATCH function.

Ron Rosenfeld[_2_]

How to get SUM of range of cells based on two separate dropdown selections.
 
On Tue, 8 May 2012 15:30:30 +0000, Bretai2k wrote:


I have 2 dropdowns (A2 and B2) on sheet 1 that both reference cells B2
through B75 on sheet 2. I want to be able to do a SUM of all cells in
the B column of sheet 2 between what I select in dropdowns A2 and B2.

I can provide examples if this is not clear enough.

TIA



Try: =SUM(INDIRECT(A2&":"&B2))

(Assumes when you write "between" you want to also include the cells identified in A2 and B2).

Mazzaropi

Quote:

Originally Posted by Bretai2k (Post 1601624)
Concatenate might be what I am looking for, but I'm trying to understand what the Plan2 are referencing. When I plug it in, it asks me to update values and then I get #N/A? for the two Plan2s that are referenced after the MATCH function.

Dear Bretai2k, Good Evening.

I´m sorry!
As my Excel is in Portuguese the sheet here is called Plan.
I forgot to change this for you.

Try this one now.

=SUM(INDIRECT(CONCATENATE("Sheet2!$B",MATCH(A2,She et2!$B$2:$B$75,0)+1,":$B",MATCH(B2,Sheet2!$B$2:$B$ 75, 0)+1)))

Have a nice day.

Bretai2k

Quote:

Originally Posted by Mazzaropi (Post 1601644)
Dear Bretai2k, Good Evening.

I´m sorry!
As my Excel is in Portuguese the sheet here is called Plan.
I forgot to change this for you.

Try this one now.

=SUM(INDIRECT(CONCATENATE("Sheet2!$B",MATCH(A2,She et2!$B$2:$B$75,0)+1,":$B",MATCH(B2,Sheet2!$B$2:$B$ 75, 0)+1)))

Have a nice day.

Thank you so much for your help thus far. I'm still getting #N/A when it gets to the Sheet2! portion of each Match function. The actual range of cells I want to validate against is on Sheet1, cells B2 through B75, while the function is checking the start and end of the range on sheet 2, cells A2 and B2.

Ron Rosenfeld[_2_]

How to get SUM of range of cells based on two separate dropdown selections.
 
On Tue, 08 May 2012 21:25:19 -0400, Ron Rosenfeld wrote:

On Tue, 8 May 2012 15:30:30 +0000, Bretai2k wrote:


I have 2 dropdowns (A2 and B2) on sheet 1 that both reference cells B2
through B75 on sheet 2. I want to be able to do a SUM of all cells in
the B column of sheet 2 between what I select in dropdowns A2 and B2.

I can provide examples if this is not clear enough.

TIA



Try: =SUM(INDIRECT(A2&":"&B2))

(Assumes when you write "between" you want to also include the cells identified in A2 and B2).


I missed that the data and dropdowns are on separate sheets.

If your formula is on Sheet 1, then use this:

=SUM(INDIRECT("Sheet2!"&A2&":"&B2))

If your formula is not on Sheet1, try this:

=SUM(INDIRECT("Sheet2!"&Sheet1!A2&":"&Sheet1!B2))

Mazzaropi

Quote:

Originally Posted by Bretai2k (Post 1601645)
Thank you so much for your help thus far. I'm still getting #N/A when it gets to the Sheet2! portion of each Match function. The actual range of cells I want to validate against is on Sheet1, cells B2 through B75, while the function is checking the start and end of the range on sheet 2, cells A2 and B2.

<<<<< HELP from BRAZIL

Dear Bretai2k, Good Morning.

It´s very important always, the user attach here a worksheet with an example about your question.
It´s quicker, easier and all the answers are effective on the solution.

At first time you said:
"...Originally Posted by Bretai2k
I have 2 dropdowns (A2 and B2) on sheet 1 that both reference cells B2 through B75 on sheet 2. I want to be able to do a SUM of all cells in the B column of sheet 2 between what I select in dropdowns A2 and B2.
I can provide examples if this is not clear enough.TIA
..."

Then, the formula was built pointing to these cells.
=SUM(INDIRECT(CONCATENATE("Sheet2!$B",MATCH(A2,She et2!$B$2:$B$75,0)+1,":$B",MATCH(B2,Sheet2!$B$2:$B$ 75, 0)+1))

NOW, you´re saying this:
"...The actual range of cells I want to validate against is on Sheet1, cells B2 through B75, while the function is checking the start and end of the range on sheet 2, cells A2 and B2...."
Then you need to invert the formula.

Put on any cell on SHEET2 this fórmula:
=SUM(INDIRECT(CONCATENATE("Sheet1!$B",MATCH(A2,She et1!$B$2:$B$75,0)+1,":$B",MATCH(B2,Sheet1!$B$2:$B$ 75, 0)+1))

Is this working for you now?

Bretai2k

1 Attachment(s)
Quote:

Originally Posted by Mazzaropi (Post 1601658)
<<<<< HELP from BRAZIL

Dear Bretai2k, Good Morning.

It´s very important always, the user attach here a worksheet with an example about your question.
It´s quicker, easier and all the answers are effective on the solution.

At first time you said:
"...Originally Posted by Bretai2k
I have 2 dropdowns (A2 and B2) on sheet 1 that both reference cells B2 through B75 on sheet 2. I want to be able to do a SUM of all cells in the B column of sheet 2 between what I select in dropdowns A2 and B2.
I can provide examples if this is not clear enough.TIA
..."

Then, the formula was built pointing to these cells.
=SUM(INDIRECT(CONCATENATE("Sheet2!$B",MATCH(A2,She et2!$B$2:$B$75,0)+1,":$B",MATCH(B2,Sheet2!$B$2:$B$ 75, 0)+1))

NOW, you´re saying this:
"...The actual range of cells I want to validate against is on Sheet1, cells B2 through B75, while the function is checking the start and end of the range on sheet 2, cells A2 and B2...."
Then you need to invert the formula.

Put on any cell on SHEET2 this fórmula:
=SUM(INDIRECT(CONCATENATE("Sheet1!$B",MATCH(A2,She et1!$B$2:$B$75,0)+1,":$B",MATCH(B2,Sheet1!$B$2:$B$ 75, 0)+1))

Is this working for you now?

It still does not appear to be working. It could simply be that I am not asking the correct question. I'm sorry, I should have added the spreadsheet in question from the get go and here it is. Basically I want to select an option for Sheet2 A2 (sorry my sheets are named backwards), also select an option for Sheet2 B2, then have a function that looks at A2 and B2 on Sheet 2, then uses A2 as it's start point, and B2 as it's end point for giving a SUM of every item in the list in Sheet 1 B3 through B78, and give me the result.

Hope this helps you help me :D.

Again, thank you for all of your help on this.

Spencer101

1 Attachment(s)
Quote:

Originally Posted by Bretai2k (Post 1601716)
It still does not appear to be working. It could simply be that I am not asking the correct question. I'm sorry, I should have added the spreadsheet in question from the get go and here it is. Basically I want to select an option for Sheet2 A2 (sorry my sheets are named backwards), also select an option for Sheet2 B2, then have a function that looks at A2 and B2 on Sheet 2, then uses A2 as it's start point, and B2 as it's end point for giving a SUM of every item in the list in Sheet 1 B3 through B78, and give me the result.

Hope this helps you help me :D.

Again, thank you for all of your help on this.


Have a look at the attached, specifically the yellow cell (G6).
Is this what you mean??

Bretai2k

Quote:

Originally Posted by Spencer101 (Post 1601717)
Have a look at the attached, specifically the yellow cell (G6).
Is this what you mean??

Thats exactly what I was looking for, thank you so much! Now time to start learning how this forumla works :D.

Thank you all again for your help!


All times are GMT +1. The time now is 02:51 PM.

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