# Trying to do Sumif using the worksheet no

#### mushmoom

##### Board Regular
Hi there

I dont know if i will be able to explain this but here I go.

I am trying to to a sumif to get the result in a different sheet the first thing i need to do is to find sheetnames from workbook then once the workbookname is fund then set the range and the usual,

here I try to explian again in

Where (workbook(sheetname)=A1,sumif(workbook!sheetA1!A1:A30,D1,Workbook!sheetA1!D1:D30)

and i need this to work for to workbook is it possiable.

thanks

I hope i have explained it .

### Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.

#### DonkeyOte

##### MrExcel MVP
take a look at the INDIRECT function in Help.

INDIRECT essentially evaluates the string within ()

ie

=INDIRECT("A1") translates as =A1
=INDIRECT("Sheet1!A1") translates as =Sheet1!A1

If say cell A1 = "SUM(Sheet1!B10:D10)"

=INDIRECT(A1) would translate as =SUM(Sheet1!B10:D10)

so you just need to construct a variable text string where sheet name is a variable etc...

#### mushmoom

##### Board Regular
see column A got the sheetname what i need to do the get the data from 2 workbooks which contain sheet with the same name as in column A

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.

### Forum statistics

1,163,988
Messages
5,834,729
Members
430,314
Latest member
Kym_beginner_in_VBA

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