vlookup as part of the sum function

jbusby825

New Member
Joined
Jan 27, 2016
Messages
25
Office Version
  1. 365
Platform
  1. Windows
i have the following table:

Table 1
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]payment 1[/TD]
[TD]375[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]payment 2[/TD]
[TD]370[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]payment 3[/TD]
[TD]365[/TD]
[/TR]
</tbody>[/TABLE]

I want to create summary in another sheet that if I put "2" then i want to sum both the 375 + 370, but if I put 3 then sum all 3 figures. I was trying to do something along the lines of

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]payment 2[/TD]
[TD]=sum('Table 1'!b1:vlookup(a1,'Table 1'!a1:b3,2,false))[/TD]
[/TR]
</tbody>[/TABLE]

I got an error on this so obviously i'm not doing something correctly.

How would i be able to accomplish this? (obviously this is on a much grander scale as it has about 360 rows and 11 columns in my real table)

Thank you!
jbusby825
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
How about just something like:
Code:
[COLOR=#333333]= 'Table 1'!b1 + vlookup(a1,'Table 1'!a1:b3,2,false)[/COLOR]
 
Upvote 0
How about:

=SUM(INDIRECT("'Table 1'!B2:B" & MATCH(A2,'Table 1'!$A$1:$A$1000,0)))
 
Upvote 0
@Joe4 this would only add up the 1st item and then the item from the vlookup. i was needing to add up from the 1st item THRU the item in the vlookup. the sumif formula above worked great. thanks for input.
 
Upvote 0
this would only add up the 1st item and then the item from the vlookup. i was needing to add up from the 1st item THRU the item in the vlookup.
My apologies. I misread the question.
 
Upvote 0

Forum statistics

Threads
1,223,975
Messages
6,175,742
Members
452,667
Latest member
vanessavalentino83

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