SUMIF Stops working when data is refreshed

Jazzer

Board Regular
Joined
Jun 14, 2011
Messages
71
Hi

I have the following sumif which returns the correct data. =SUMIF(DATA!L7:L43,test!D11,DATA!R7:R43)<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
The data on the "data" tab needs to be refreshed on a daily basis (this is done by macro which deletes and imports the new data from a text file) however when my data is refreshed I get #REF! and my formula becomes =SUMIF(DATA!#REF!,test!D11,DATA!#REF!)<o:p></o:p>
if I then manually change the formula back it still picks up the correct data.<o:p></o:p>
<o:p></o:p>
any idea how I can stop this please?<o:p></o:p>
<o:p></o:p>
Many Thanks<o:p></o:p>
James<o:p></o:p>
 

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.
I suspect your macro is deleting the cells rather than just clearing them. If you can't change that, then use something like:
=SUMIF(INDIRECT("DATA!L7:L43"),test!D11,INDIRECT("DATA!R7:R43"))
 
Upvote 0
Thanks Rory.

much appreciated<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
 
Upvote 0
Just trying to use the same principle on another sheet however I am receiving a #REF! Error<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
Can you see any reason for this...<o:p></o:p>
<o:p></o:p>
=SUMIF(INDIRECT("LCH DATA!E10:E12"),LCH EUR!F6,INDIRECT("LCH DATA!F10:F12"))<o:p></o:p>
<o:p></o:p>
Many Thanks<o:p></o:p>
James<o:p></o:p>
<o:p></o:p>
 
Upvote 0
You have spaces in the sheet names so you need to enclose them all in single quotes:
=SUMIF(INDIRECT("'LCH DATA'!E10:E12"),'LCH EUR'!F6,INDIRECT("'LCH DATA'!F10:F12"))
 
Upvote 0
Just trying to use the same principle on another sheet however I am receiving a #REF! Error<o:p></o:p>
Can you see any reason for this...<o:p></o:p>
<o:p></o:p>
=SUMIF(INDIRECT("LCH DATA!E10:E12"),LCH EUR!F6,INDIRECT("LCH DATA!F10:F12"))<o:p></o:p>
<o:p></o:p>
Many Thanks<o:p></o:p>
James<o:p></o:p>
<o:p></o:p>
Hi! i think this reason closing with your macro code (after deleting prosess it becomes error)
can you post your macro code?
 
Upvote 0
You have spaces in the sheet names so you need to enclose them all in single quotes:<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
=SUMIF(INDIRECT("'LCH DATA'!E10:E12"),'LCH EUR'!F6,INDIRECT("'LCH DATA'!F10:F12"))
<o:p></o:p>
<o:p></o:p>
Thanks Rory - this has eradicated the ref error<o:p></o:p>
however just one last thing to resolve<o:p></o:p>
<o:p></o:p>
the original sumif returns the correct number<o:p></o:p>
<o:p></o:p>
=SUMIF('LCH DATA'!E10:E12,'LCH EUR'!F6,'LCH DATA'!F10:F12)<o:p></o:p>
<o:p></o:p>
the new sumif is now returning TRUE<o:p></o:p>
<o:p></o:p>
=SUMIF(INDIRECT("'LCH DATA'!E10:E12"),'LCH EUR'!F6,INDIRECT("'LCH DATA'!F10:F12"))<o:p></o:p>
<o:p></o:p>
if I can fix this my sheet will be up and running.<o:p></o:p>
<o:p></o:p>
Thanks again<o:p></o:p>
<o:p></o:p>
James<o:p></o:p>
 
Upvote 0
I can't see any reason why that should be. What is the cell format?
 
Upvote 0
Cells are on number format<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
<o:p></o:p>
It seems strange as the other sheet is working fine<o:p></o:p>
<o:p></o:p>
=SUMIF(INDIRECT("DATA!L7:L43"),test!D11,INDIRECT("DATA!R7:R43"))<o:p></o:p>
<o:p></o:p>
above returns the desired numerical answer<o:p></o:p>
<o:p></o:p>
=SUMIF(INDIRECT("'LCH DATA'!E10:E12"),'LCH EUR'!F6,INDIRECT("'LCH DATA'!F10:F12"))<o:p></o:p>
<o:p></o:p>
above returns TRUE<o:p></o:p>
<o:p> </o:p>
<o:p> </o:p>
 
Upvote 0

Forum statistics

Threads
1,224,541
Messages
6,179,418
Members
452,912
Latest member
alicemil

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