Please help me with a formula!

underexaggeration

New Member
Joined
Jun 16, 2016
Messages
2
[FONT=&quot]Simplified version so it makes sense. [/FONT]

[FONT=&quot]I have two columns of data. In the first is a series of numbers. In the second is a series of numbers (all integers between 1 and 10) that is generated independantly of the first. [/FONT]

[FONT=&quot]At the bottom of the first column, I want a formula that only sums the values of the column which correspond to a value n in the same row of the second column. [/FONT]

[FONT=&quot]Example [/FONT]
[FONT=&quot]1 5 [/FONT]
[FONT=&quot]5 6 [/FONT]
[FONT=&quot]4 5 [/FONT]
[FONT=&quot]3 7 [/FONT]
[FONT=&quot]1 0 [/FONT]
[FONT=&quot]5 9 [/FONT]
[FONT=&quot]9 8 [/FONT]
[FONT=&quot]8 5 [/FONT]
[FONT=&quot]If n=5, the the formula would output 1+4+8=13, as 1,4 and 8 are the only values in column 1 which correspond to a 5 in column 2. [/FONT]

[FONT=&quot]Thanks everyone! If the answer is "Can't be done!" please let me know so I don't waste any time.[/FONT]
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Simplified version so it makes sense.

I have two columns of data. In the first is a series of numbers. In the second is a series of numbers (all integers between 1 and 10) that is generated independantly of the first.

At the bottom of the first column, I want a formula that only sums the values of the column which correspond to a value n in the same row of the second column.

Example
1 5
5 6
4 5
3 7
1 0
5 9
9 8
8 5
If n=5, the the formula would output 1+4+8=13, as 1,4 and 8 are the only values in column 1 which correspond to a 5 in column 2.

Thanks everyone! If the answer is "Can't be done!" please let me know so I don't waste any time.
Hi underexaggeration, welcome to the boards.

If I have understood correctly you want to sum the values in column A where the values in column B meet your criteria? If so then is it not just:

=SUMIF(B1:B8,5,A1:A8)

If you had a cell somewhere containing your desired n value (lets say D1 for the sake of argument) then you could write the formula as:

=SUMIF(B1:B8,D1,A1:A8)
 
Upvote 0
15row 12
56
45
37
10
59
98
85
col Acol Bselect a number5<<<<g22< td=""></g22<>G22
13
=SUMPRODUCT(($B$12:$B$19=$G$22)*($A$12:$A$19))

<tbody>
</tbody>
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,430
Messages
6,124,849
Members
449,194
Latest member
HellScout

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