SUMIF formula with INDIRECT and LEFT as reference

AndreK123

New Member
Joined
Jan 19, 2017
Messages
11
I need to sum up data using the first three letters as the ref point across multiple sheets, I have the current formula but it does not work, any other options?
Thank you

=SUMIF(LEFT(INDIRECT("'PL "&R$16&"'!$A:$A"),3),'Monthly Pos PnL Admin Data-->'!$A61,INDIRECT("'PL "&R$16&"'!$G:$G"))

The INDIRECT function references a monthly sheet where the data exists but need to be able to drag across to pick up data from multiple months which is why using INDIRECT function

Any help appreciated!!
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
What does "it does not work" mean?

You are getting an error? Which error?
You are not getting the results you expect?

Are the files you refer to actually open?
 
Upvote 0
I just get a general "there is a problem with the formula"
The sheets are open as they are in the same excel book

So for example, I have a sheet for January 2016 called Jan 16 where I want to pick up all the values relating to a securities where the first three letters start with HYG
Then I need the formula to summarise the profit made for those same securities for February 2016 in a sheet called Feb 16 which is why I am trying to automate it so I can drag across for all the months

Hopefully that is clearer?
 
Upvote 0
Am certain you cant do this

LEFT(INDIRECT("'PL "&R$16&"'!$A:$A"),3)

LEFT of the entire column A ?
LEFT only works on an individual string.
 
Upvote 0
SUMIF requires a range as its first argument.

Try SUMPRODUCT. Something like
=SUMPRODUCT(--(LEFT(INDIRECT(.....),3)="HYG"),INDIRECT(....))

Remark: avoid references to entire columns, like A:A or G:G, in SUMPRODUCT. Use definite ranges, for example, A1:A1000 and G1:G1000 - adjust to suit.

M.
 
Upvote 0
Another

=SUMIF(INDIRECT("'PL "&R$16&"'!$A:$A"),'Monthly Pos PnL Admin Data-->'!$A61&"*",INDIRECT("'PL "&R$16&"'!$G:$G"))

where 'Monthly Pos PnL Admin Data-->'!$A61 = HYG

M.
 
Upvote 0

Forum statistics

Threads
1,214,813
Messages
6,121,706
Members
449,048
Latest member
81jamesacct

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