Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 15491

Converting complex Formula into Dynamic Array

$
0
0

Trying to create a Dynamic array from a somewhat complex formula but keep getting #N/A errors randomly.

enter image description here

For some reason, the y value of the equations doesn't like it.

Effectively the #N/A for the first instance is saying it can't find 0.57 in the particle diameter table on the left, despite clearly being listed.

Data to mimic:

Table1:

Particle Diameter δ (μm)Rairborne(δ) (kg/s)γ(δ)
0.0000.000555556
0.192.33195E-150.000556338
0.385.3411E-150.000558686
0.577.49672E-150.000562599
0.768.93319E-150.000568078
0.959.85973E-150.000575121
1.141.04323E-140.00058373
1.331.07581E-140.000593905
1.521.09105E-140.000605644
1.711.09403E-140.000618949
1.901.0883E-140.000633819
2.091.07639E-140.000650254

InputParameters:

Spray Duration (minutes)
11.1

Problematic Formula:

=MAKEARRAY(10,11,LAMBDA(x,y,IF(x*7.8 <= InputParameters[[Spray Duration (minutes)]:[Spray Duration (minutes)]] * 60,XLOOKUP(y*0.19, Table1[[Particle Diameter δ (μm)]:[Particle Diameter δ (μm)]], Table1[[Rairborne(δ) (kg/s)]:[Rairborne(δ) (kg/s)]]) *    (1 - EXP(-XLOOKUP(y*0.19, Table1[[Particle Diameter δ (μm)]:[Particle Diameter δ (μm)]], Table1[[γ(δ)]:[γ(δ)]]) * x*7.8)) /    XLOOKUP(y*0.19, Table1[[Particle Diameter δ (μm)]:[Particle Diameter δ (μm)]], Table1[[γ(δ)]:[γ(δ)]]),XLOOKUP(y*0.19, Table1[[Particle Diameter δ (μm)]:[Particle Diameter δ (μm)]], Table1[[Rairborne(δ) (kg/s)]:[Rairborne(δ) (kg/s)]]) /    XLOOKUP(y*0.19, Table1[[Particle Diameter δ (μm)]:[Particle Diameter δ (μm)]], Table1[[γ(δ)]:[γ(δ)]]) *    (1 - EXP(-XLOOKUP(y*0.19, Table1[[Particle Diameter δ (μm)]:[Particle Diameter δ (μm)]], Table1[[γ(δ)]:[γ(δ)]]) * (InputParameters[[Spray Duration (minutes)]:[Spray Duration (minutes)]] * 60))) *    EXP(-XLOOKUP(y*0.19, Table1[[Particle Diameter δ (μm)]:[Particle Diameter δ (μm)]], Table1[[γ(δ)]:[γ(δ)]]) * (x*7.8 - (InputParameters[[Spray Duration (minutes)]:[Spray Duration (minutes)]] * 60))))))

Correct data (When using the long formula and dragging) (particle size on top, Time down the LHS):

| TIME (s) | 0       | 0.19    | 0.38    | 0.57    | 0.76    | 0.95    ||----------|---------|---------|---------|---------|---------|---------|| 0        | 0.00E+00| 0.00E+00| 0.00E+00| 0.00E+00| 0.00E+00| 0.00E+00|| 7.80     | 0.00E+00| 1.81E-14| 4.16E-14| 5.83E-14| 6.95E-14| 7.67E-14|| 15.60    | 0.00E+00| 3.62E-14| 8.30E-14| 1.16E-13| 1.39E-13| 1.53E-13|| 23.40    | 0.00E+00| 5.42E-14| 1.24E-13| 1.74E-13| 2.08E-13| 2.29E-13|| 31.20    | 0.00E+00| 7.21E-14| 1.65E-13| 2.32E-13| 2.76E-13| 3.05E-13|| 39.00    | 0.00E+00| 9.00E-14| 2.06E-13| 2.89E-13| 3.45E-13| 3.80E-13|| 46.80    | 0.00E+00| 1.08E-13| 2.47E-13| 3.46E-13| 4.13E-13| 4.55E-13|| 54.60    | 0.00E+00| 1.25E-13| 2.87E-13| 4.03E-13| 4.80E-13| 5.30E-13|| 62.40    | 0.00E+00| 1.43E-13| 3.28E-13| 4.60E-13| 5.48E-13| 6.04E-13|| 70.20    | 0.00E+00| 1.61E-13| 3.68E-13| 5.16E-13| 6.15E-13| 6.78E-13|| 78.00    | 0.00E+00| 1.78E-13| 4.08E-13| 5.72E-13| 6.82E-13| 7.52E-13|| 85.80    | 0.00E+00| 1.95E-13| 4.47E-13| 6.28E-13| 7.48E-13| 8.25E-13|

For some reason it seems to think this is code and wont let me submit unless formatted as code despite using markdown

LINK TO WORKBOOK IN IMAGE:

https://1drv.ms/x/s!AsrLaUgt0KCLxXOWIrFQWEaQoxky?e=vnORUu

Update1 Adding &"":

enter image description here

Update2 Adding TRUE and Setting y*0.19 to the array

enter image description here


Viewing all articles
Browse latest Browse all 15491

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>