Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-02-2023, 10:26 AM
wcstarks wcstarks is offline Vlookup formula no longer producing proper result Windows 10 Vlookup formula no longer producing proper result Office 2019
Novice
Vlookup formula no longer producing proper result
 
Join Date: Feb 2019
Posts: 2
wcstarks is on a distinguished road
Default Vlookup formula no longer producing proper result

See Attachment



In the Q1 table, I have three fields related to the Glucose reading.
(D) Libre reading (continuous monitoring sensor)

(E) Blood reading
(F) Calibrated Glucose value


I divide the blood reading by the Libre reading to produce a calibration factor. This factor is stored in the "Glucose Factor" table by start date. This calibration factor varies from one sensor to the next. Each sensor lasts 14 days. I need to re-calibrate each new sensor after it is installed. The factor usually varies +- around 1.0. The factor for several of the previous sensors was .9x. The factor for the current reading is 1.03.



The Glucose Column contains a formula which looks up the factor in the "Glucose Factor" table and multiplies the Libre reading by that factor for the current date to produce the calibrated Glucose result.



As you can see in row 3, the formula is not producing the proper result. The calibrated Glucose reading should be near 220 (219 in this case). However the formula is producing a result for a factor of .95. This is the same factor for row 29 in the Glucose Factor table beginning on 21 Jul 2023.



For some reason, the VLookup function is no longer returning the correct value. It has been working for over a year. Is there a limit to the number of rows that can be in the Glucose Factor table? What has happened between Jul and Sep?


FYI: Row 2 is hidden to preserve formatting when I insert new rows at the top.
Attached Files
File Type: zip Diabetes Manager.zip (873.7 KB, 4 views)
Reply With Quote
  #2  
Old 09-03-2023, 04:59 AM
p45cal's Avatar
p45cal p45cal is offline Vlookup formula no longer producing proper result Windows 10 Vlookup formula no longer producing proper result Office 2021
Expert
 
Join Date: Apr 2014
Posts: 871
p45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond repute
Default

The formula in column F refers to a named range GlucoseFactor. There are in fact 2 such named ranges, one Workbook-scoped and one Sheet-scoped. One refers to:
='Glucose Factor'!$A$2:$B$29
the other to:
='Glucose Factor'!$A$2:$B$32
I suggest you change the formula to:
=IF([@Libre]=0,[@Blood], IF([@Libre]>0,[@Libre]*VLOOKUP([@Date],Table4,2),0))
Reply With Quote
  #3  
Old 09-05-2023, 10:46 PM
ArviLaanemets ArviLaanemets is offline Vlookup formula no longer producing proper result Windows 8 Vlookup formula no longer producing proper result Office 2016
Expert
 
Join Date: May 2017
Posts: 873
ArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud ofArviLaanemets has much to be proud of
Default

On sheet Glucose Factor you have a Defined Table Table4, which expands automatically whenever you add new rows to this table. You also have defined a Named Range ClucoseFactor='Glucose Factor'!$A$2:$B$29, which defines a range of table on sheet Glucose factor from rows 2:29. This named range is fixed one - remains same when you add new glucose factor values. In your formula, you refer to this fixed range! Replace it with reference to Defined Table instead (like p45cal adviced)!
Code:
=IF([@Libre]=0,[@Blood], IF([@Libre]>0;[@Libre]*VLOOKUP([@Date],Table4,2),0))
And you have more than one copy of Named Ranges there - with scope 'Workbook', and with scope 'Prt Date Rng'. A possible explanation is, you created the sheet 'Prt Date Rng' coping some other sheet where those named ranges were used in formulas (or did some other copy-paste operation which had this effect). Probably you have to delete all Named Ranges with worksheet scope (Except the ones used to define Print Areas) to avoid some problems in future (I suspect when the scope is a worksheet, you can refer to this range from this worksheet only, and as both copies of range have same name, it is up to Excel to decide, which one is referred to!).
Reply With Quote
Reply

Tags
vlookup



Similar Threads
Thread Thread Starter Forum Replies Last Post
Vlookup - if the result is blank then enter a formula srsev6 Excel 5 03-01-2019 07:48 AM
Vlookup formula no longer producing proper result Possible to use an existing vlookup formula to also insert correct info and trigger a SUM formula innkeeper9 Excel 2 09-13-2016 08:59 PM
Vlookup formula no longer producing proper result How To Move Focus From VLOOKUP Result to Report Sheet swindon.expat Excel 2 04-10-2016 12:15 AM
Vlookup formula no longer producing proper result formula, 2 criteria, one result cjdstephenson Excel 4 06-02-2015 09:17 PM
Vlookup formula no longer producing proper result Fetching more than one result with VLookup on multiple sheets lilvillaf Excel 2 06-12-2014 05:39 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:06 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft