Unique Vlookup with Static Table Array but Dynamic Cell Values - Problem

NegativeKurtosis

New Member
Joined
Jan 14, 2018
Messages
15
Hello Everyone ! Hoping some of the brilliant, creative minds here can offer some suggestions.

I'm working on an assignment and having a great deal of difficulty finding a solution that works. Here is the situation :

I have a dynamic sheet that updates every hour via a web query. I have 2 VBA macros that handle "updating" the columns within the range $I$4:$O$517 with the web query data as it comes in. The TABLE ARRAY RANGE itself DOES NOT CHANGE. I have found a hundred examples on line that explain how to handle dynamic table arrays or dynamic column index numbers but nothing on how to deal with a table array that remains static but has it's values INSIDE that table array changing. The problem is that when the data is changed within the table array $I$4:$O$517 .....ie from the web query update, my Vlookup formula does not work. Nor can I get an index / match or vlookup / If / offset / counta combination formula to work either. I want to have faith that this is not some obscure method for which a creative nested formula can't be created. I have scoured the Forum, Google, as well as manipulating the aformentioned functions a dozen different ways but always end up with an NA error.

Here is my current static formula :

=IF(Q517>0,VLOOKUP(Q517,$I$4:$O$517,7,FALSE),VLOOKUP(Q517,$AB$4:$AH$517,7,FALSE))

I am dealing with positive and negative numbers, hence the >0 reference which checks two different table array ranges and determines which one to obtain the desired value from. I need to be able to obtain the CELL'S VALUE that I get with the static Vlookup formula with a dynamically updating Vlookup formula ( or some derivation of it ).
My lookup value is : Q517 ......this value gets updated every hour, but once this becomes dynamic ( ie....once the web query starts, the vlookup stops working and all other derivations of it). As mentioned previously I have created many combinations of If / Offset / Counta / Index / Match / Vlookup but to no avail.

Any suggestions or insights would be greatly appreciated.

Richard
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Hi - welcome to the board.

You've given a good description of the form of yhour problem but not it's content. Could you take us through a worked example of the problem so we can get a better understanding...
 
Upvote 0
A quick screen shot of both tables (unless the tables have given names) would help me understand what and how your data is "fluctuating" due to the web lookup.
 
Upvote 0
Paddy D,

Sorry, I see that the screenshots did not work. Let me figure out how to send a screenshot. I have two annotated screenshots.

Richard
 
Upvote 0
Paddy D,

See screenshots and notes below :

152.470.00429-0.0093350.2320.39195.91
152.46-0.0007590.0028660.2300.00195.91
152.46-0.005020.004290.2420.39196.30
152.47-0.002083-0.0007590.2400.00196.30
152.47-0.001614-0.005020.2420.39196.69
152.460.004546-0.0020830.2400.00196.69
152.46-0.015258-0.0016140.2520.39197.08
152.46-0.0041290.0045460.2500.00197.08
152.460.003293-0.0152580.2610.19197.28
152.450.008508-0.0041290.2710.19197.47
152.44-0.0287480.0032930.2810.19197.67
152.4500.0085080.2910.19197.86
152.45-0.067396-0.0287480.320.39198.25
152.42-0.00593900.300.00198.25
152.420-0.0673960.3110.19198.44
152.36-0.001212-0.0059390.3510.19198.64
152.35000.3810.19198.83
152.35#REF!0.0733351.47682410.19199.03
152.35#REF!0.0142276.92221210.19199.22
152.35
ELECTRICAL DIFFERENCE BIN LIMITS CUMULATIVE
VALUES DIFFERENCES VALUES FOR POSITIVE FREQUENCY PERCENT PERCENT
ONLY ONLY DIFFERENCES FREQUENCY FREQUENCY

<colgroup><col style="mso-width-source:userset;mso-width-alt:2925;width:60pt" width="80"> <col style="width:48pt" width="64"> <col style="mso-width-source:userset;mso-width-alt:3145;width:65pt" width="86"> <col style="width:48pt" width="64"> <col style="mso-width-source:userset;mso-width-alt:2852;width:59pt" width="78"> <col style="width:48pt" width="64"> <col style="mso-width-source:userset;mso-width-alt:3291;width:68pt" width="90"> <col style="width:48pt" width="64"> <col style="mso-width-source:userset;mso-width-alt:2779;width:57pt" width="76"> <col style="width:48pt" width="64"> <col style="mso-width-source:userset;mso-width-alt:2889;width:59pt" width="79"> <col style="width:48pt" width="64"> <col style="mso-width-source:userset;mso-width-alt:3108;width:64pt" width="85"> <col style="width:48pt" width="64"> </colgroup><tbody>
</tbody>
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


195.91-5.783861-0.0112-0.00402#N/A#N/A#N/A
195.91-0.0069060.000268-0.00218#N/A#N/A#N/A
196.30-0.000491-0.002940.006397#N/A#N/A#N/A
196.30-0.0079580.001377-0.00149#N/A#N/A#N/A
196.69-0.000706-0.00357-0.00786144.1634#N/A#N/A
196.69-0.005186-0.00948-0.00872143.1907#N/A#N/A
197.08-0.00493-0.004170.000849143.3852#N/A#N/A
197.08-0.019429-0.01441-0.01233137.9377#N/A#N/A
197.28-0.018538-0.01646-0.01484137.9377#N/A#N/A
197.47-0.013162-0.01155-0.01609138.1323#N/A#N/A
197.67-0.00304-0.007590.007672143.5798#N/A149.8054
197.86-0.036334-0.02108-0.01695130.5447#N/A#N/A
198.25-0.021076-0.01695-0.02024133.463#N/A#N/A
198.25-0.084343-0.08764-0.09614118.677#N/A#N/A
198.44-0.093575-0.10208-0.07333#N/A#N/A#N/A
198.64-0.102083-0.07333-0.07333Imported Hourly115.1751#N/A#N/A
198.83-0.074547-0.07455-0.00715Phase Angle 152.346580.006564120.0389#N/A#N/A
199.03-0.074547-0.00715-0.00121Calculation120.0389#N/A#N/A
199.22-152.36-152.352-152.352#N/A#N/A#N/A
#N/A56.22568232
CUMULATIVE 3RD2ND1ST 3RD2ND1ST
PERCENT THREE PHASE LAG VALUE DIFFERENCES CORRESPONDING PROBABILITY PERCENTAGES
FREQUENCY FOR PHASE ANGLE TO RETAIN CURRENT VOLTAGE

<colgroup><col style="mso-width-source:userset;mso-width-alt:3108;width:64pt" width="85"> <col style="width:48pt" width="64"> <col style="mso-width-source:userset;mso-width-alt:2486;width:51pt" width="68"> <col style="width:48pt" span="2" width="64"> <col style="mso-width-source:userset;mso-width-alt:5705;width:117pt" width="156"> <col style="mso-width-source:userset;mso-width-alt:2560;width:53pt" width="70"> <col style="mso-width-source:userset;mso-width-alt:3145;width:65pt" width="86"> <col style="width:48pt" span="5" width="64"> </colgroup><tbody>
</tbody>
The imported hourly phase angle calculation is dynamic, it updates every hour from a web and it is what "feeds" the rest of the calculations...ie...the columns A through I. Columns Q,R,S are updated by the data calculated in columns A through I. This formula :

=IF($Q$517>0,VLOOKUP($Q$517,$I$4:$O$517,7,TRUE),VLOOKUP($Q$517,$AB$4:$AH$517,7,TRUE))

=IF($R$517>0,VLOOKUP($R$517,$I$4:$O$517,7,TRUE),VLOOKUP($R$517,$AB$4:$AH$517,7,TRUE))

=IF($S$517>0,VLOOKUP($S$517,$I$4:$O$517,7,TRUE),VLOOKUP($S$517,$AB$4:$AH$517,7,TRUE))

Is then supposed to find the closest corresponding values ( $Q$517, $ R$517, $S$517 in the table array : $I$4:$O$517 or table array : $AB$4:$AH$517 depending on whether or not the value is greater than 0. That value ( also called...the percentage probability of the phase angle ) is in column 7 as noted in the formula. The problem is that columns X,Y,Z do not update dynamically when all the other columns change as the imported hourly phase angle calculation provides new data. The table array doesn't change in size but it does inherit new cell values.

To recap, columns A through S have the potential to change every hour. Columns X,Y,Z need to be able to update as well based on the changes in the appropriately chosen table array. Hope this helps clarify.

Richard
 
Upvote 0
Do your tables have names?

you could try switching to table names:-

=IF($S$517>0,VLOOKUP($S$517,Table1[#Data],7,TRUE),VLOOKUP($S$517,Table2[#Data],7,TRUE))

The same could be said for the web updated data if you can place that in a dynamic table as long as the name stays the same - you could replace Q, R &S so:-

=IF(UpdateQ[#Data]>0,VLOOKUP(UpdateQ[#Data],Table_I_O[#Data],7,TRUE),VLOOKUP(UpdateQ[#Data],Table_AB_AH[#Data],7,TRUE))

You might have to change the column you are looking in to allow for a complete table, with the [#Data] link it shouldn't matter where the match is within it.

From you screen shots it is hard to discern where AB:AH is, so I hope this helps.
 
Upvote 0
dnorm,

Table array AB:AH is off to the right; Thanks for the suggestion ! I will investigate renaming the table names.

Thanks,
Richard
 
Upvote 0
dnorm,

Thanks for checking back in. Unfortunately it did not work; the reason being because it is a multi - cell array formula and Excel 2016 will not allow multi - cell array formulas to be used in tables. I am still working on it. Here is what I have created in the interim :

=IF(Q516>0,INDEX($O$4:$O$517,MATCH($Q$516,$I$4:$I$517,1)))

AND

=IF(Q516<0,INDEX($AB$4:$AB$517,MATCH($Q$516,$AH$4:$AH$517,1)))

Been testing this today; not 100 % certain that this is working either. Beginning to think that I can't do this analysis in Excel. I don't want to, but I may have to try to solve this in R Studio unless someone in the forum has any viable suggestions.

Richard
 
Upvote 0

Forum statistics

Threads
1,214,589
Messages
6,120,415
Members
448,960
Latest member
AKSMITH

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