# give the total from the different table

#### mark692

##### Active Member
hi guys i have two tables in different sheet on sheet 1 is where i want to put the total of the amount that i input on table 2 on sheet 2 depending on name on column B and the header of the table, like the sample table below

ABCDEFGHI
1Table 1 on sheet 1
2123456
3Cash10050
4Receivable50
5Payable60
6
7
8Data on sheet 2
9123456
10Cash20
11Receivable60
12Payable
13Cash3050
14cash50
15Payable50
16

</tbody>
Sheet1

### Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.

##### MrExcel MVP
Given: A:G of Sheet1 with A2 = Cash and A:G of Sheet2 with A2 = Cash...

In C2 of Sheet 1 enter, copy across, and down:

=SUMIFS(INDEX(Sheet2!\$A:\$G,0,MATCH(B\$1,INDEX(Sheet2!\$A:\$G,1,0),0)),Sheet2!\$A:\$A,\$A2))

#### mark692

##### Active Member
Given: A:G of Sheet1 with A2 = Cash and A:G of Sheet2 with A2 = Cash...

In C2 of Sheet 1 enter, copy across, and down:

=SUMIFS(INDEX(Sheet2!\$A:\$G,0,MATCH(B\$1,INDEX(Sheet2!\$A:\$G,1,0),0)),Sheet2!\$A:\$A,\$A2))

i tried your code sir on my file i paste your code and edit it according to my table but it give me error n/a here is the SS of my table in sheet 1
cell e 16 is where i want to put the code

[/URL][/IMG]

and here is the table in sheet 2

[/URL][/IMG]

##### MrExcel MVP
i tried your code sir on my file i paste your code and edit it according to my table but it give me error n/a here is the SS of my table in sheet 1
cell e 16 is where i want to put the code

[/URL][/IMG]

and here is the table in sheet 2

[/URL][/IMG]

An image is not much of a value, as it requires re-typing everything it shows.

See rather the workbook that implements the suggestion: https://www.dropbox.com/s/aqpwkg48ml0xgen/mark692%20sumifs.xlsx?dl=0

Last edited:

#### mark692

##### Active Member

An image is not much of a value, as it requires re-typing everything it shows.

See rather the workbook that implements the suggestion: https://www.dropbox.com/s/aqpwkg48ml0xgen/mark692 sumifs.xlsx?dl=0

Sir i get the reason on why it is not working on my file, the reasons are

1. the range on sheet 2 should be not in table. but the problem is i need the data to be in a table, because i need the filter and sort functions of table.

2. the second reason is that the header of the data on sheet 2 needs to be in Row 1, if you move it on row 2 the formula will not work,

#### mark692

Up

##### MrExcel MVP

I don't follow what you are saying.

If you want the SUMIFS to be more specific...

=SUMIFS(INDEX(Sheet2!\$A\$2:\$G\$7,0,MATCH(B\$1,Sheet2!\$A\$1:\$G\$1,0)),Sheet2!\$A\$2:\$A\$7,\$A2)

#### mark692

##### Active Member
I don't follow what you are saying.

If you want the SUMIFS to be more specific...

=SUMIFS(INDEX(Sheet2!\$A\$2:\$G\$7,0,MATCH(B\$1,Sheet2!\$A\$1:\$G\$1,0)),Sheet2!\$A\$2:\$A\$7,\$A2)

i have solved it sir, thanks

Replies
4
Views
135
Replies
0
Views
44
Replies
1
Views
161
Replies
1
Views
72
Replies
2
Views
142

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

1,152,389
Messages
5,769,798
Members
425,572
Latest member
ja189704

### 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.

### Which adblocker are you using?

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

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