Formula Doesn't Calculate
-
- 4StarLounger
- Posts: 528
- Joined: 26 Jan 2010, 15:14
Formula Doesn't Calculate
Any reason why the formulas in cells T10 to T31 (of the attached file) don't give results right away?
You do not have the required permissions to view the files attached to this post.
-
- 3StarLounger
- Posts: 254
- Joined: 15 Aug 2016, 11:23
Re: Formula Doesn't Calculate
That formula (in T10) is a array formula that is inserted by pressing Ctrl + Shift + Enter simultaneously.
Enter that array formula in T10 and then drag it down where it is needed.
Enter that array formula in T10 and then drag it down where it is needed.
-
- Administrator
- Posts: 78474
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Formula Doesn't Calculate
No, it is not an array formula. HLOOKUP doesn't require that.
I have no idea why the formulas aren't recalculated. Executing
from the Immediate window in the VBE fixes it. After that, the formulas are recalculated automatically. By the way, the formula in T10 can be simplified to
=IFERROR(IF(HLOOKUP(T$1,qt!$A$1:$Q$100,$A10,FALSE)="","",HLOOKUP(T$1,qt!$A$1:$Q$100,$A10,FALSE)),"")
(I prefer using a finite range instead of entire columns)
I have no idea why the formulas aren't recalculated. Executing
Code: Select all
Application.CalculateFull
=IFERROR(IF(HLOOKUP(T$1,qt!$A$1:$Q$100,$A10,FALSE)="","",HLOOKUP(T$1,qt!$A$1:$Q$100,$A10,FALSE)),"")
(I prefer using a finite range instead of entire columns)
Best wishes,
Hans
Hans
-
- 4StarLounger
- Posts: 528
- Joined: 26 Jan 2010, 15:14
Re: Formula Doesn't Calculate
Simplifying the formula did the trick!
Thank you Hans!
Thank you Hans!
-
- 5StarLounger
- Posts: 817
- Joined: 24 Jan 2010, 15:56
Re: Formula Doesn't Calculate
Or even just this:
=IFERROR((HLOOKUP(T$1,qt!$A:$Q,$A10,FALSE)&"")+0,"")
=IFERROR((HLOOKUP(T$1,qt!$A:$Q,$A10,FALSE)&"")+0,"")
Regards,
Rory
Rory
-
- 4StarLounger
- Posts: 528
- Joined: 26 Jan 2010, 15:14
Re: Formula Doesn't Calculate
Thanks Rory, that's impressive but unfortunately, in this particular case, Hans formula does calculate while yours doesn't
You do not have the required permissions to view the files attached to this post.
-
- 4StarLounger
- Posts: 528
- Joined: 26 Jan 2010, 15:14
Re: Formula Doesn't Calculate
Well now even Hans' formula doesn't calculate after trying Rory's formula and then changing it back to Hans'
You do not have the required permissions to view the files attached to this post.
-
- 5StarLounger
- Posts: 817
- Joined: 24 Jan 2010, 15:56
-
- 4StarLounger
- Posts: 528
- Joined: 26 Jan 2010, 15:14
Re: Formula Doesn't Calculate
This is a report, I wouldn't want the people viewing it having to use Application.CalculateFull or Ctrl+Alt+F9
-
- Administrator
- Posts: 78474
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Formula Doesn't Calculate
If I enter either your (Giorgio's), my or Rory's formula in T10, it works correctly. Double-clicking the fill handle copies the formula down to T40...
Best wishes,
Hans
Hans
-
- 4StarLounger
- Posts: 528
- Joined: 26 Jan 2010, 15:14
Re: Formula Doesn't Calculate
Yes they all do but there's code in an Access file that fills the qt sheet in this Excel file
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12Xml, "qt", "O:\produzioni\stat.xlsx", True, "qt"
and that's when the trouble happens, only for column T cells and it started having this problem only two weeks ago after four years of flawless service.
Interestingly enough, I've been able to recover the Excel file saved right after using Hans' formula and before using Rory's and it works but if I put Rory's in and save it, it stops working and if I try and replace it with Hans' again it doesn't work anymore
I guess one solution could be using Application.CalculateFull when the Excel file opens
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12Xml, "qt", "O:\produzioni\stat.xlsx", True, "qt"
and that's when the trouble happens, only for column T cells and it started having this problem only two weeks ago after four years of flawless service.
Interestingly enough, I've been able to recover the Excel file saved right after using Hans' formula and before using Rory's and it works but if I put Rory's in and save it, it stops working and if I try and replace it with Hans' again it doesn't work anymore
I guess one solution could be using Application.CalculateFull when the Excel file opens
-
- Administrator
- Posts: 78474
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Formula Doesn't Calculate
That looks like a reasonable workaround.grovelli wrote:I guess one solution could be using Application.CalculateFull when the Excel file opens
Best wishes,
Hans
Hans