# Natural Log and e (exponent) functions

Hey guys. I’m new to no/low code apps so feel free to explain it like I’m a 5 year old.

I’m creating a calculator from an excel model and there’s a hand-full of excel expressions that I’ve had to “work around” in my math. Ultimately the output comes down to an exponential function that will require the usage of both natural log (LN) and exponent (e). I spent some time looking around in the community and help for supported math fx’s and didn’t see those listed.

FWIW…the actual set up is pretty straightforward. I have a column that takes the natural log (or exponent) of a record.

You can do LOG and exponents in a Math column. What is the formula you are trying to reproduce? And do you have an example of values you are feeding the formula and the expected result?

Thanks for the quick reply, Jeff. Unfortunately LOG and LN (natural log) are NOT the same thing.

Similarly the exponent “e” is NOT the same as X^2, or X^10 (see the links above). If you’re more familiar with excel, the formula for “e” is “EXP(x)”, where e^1 or EXP(1) =2.7183.

The base equation I’m solving for and using in my app is the natural decay equation. y=Ae(kt) or y=Ae^(kt).
t is time
A is a constant (i’m solving for)
k is the decay rate and a constant I’m solving for

I’ve figured out how to do the basic operations (+,-,* and /) in glide, but need to find a way (if possible) to calculate LN and e.

Something like this in a javascript column? I’m not sure if that’s exactly what you’re looking for. That’s why I asked for a current sample formula that you are using in excel and a sample result.

``````function naturalDecay(initialQuantity, decayConstant, time) {
return initialQuantity * Math.exp(-decayConstant * time);
}

return naturalDecay(p1, p2, p3);
``````

Thank you Dilon. I messed around with this some. It appears to only work on a single value? Is there a way to perform the calcs for an entire column? I have an entire column of data that I need to take the “natural log” of.

Data (input) LN (Data)
350 LN(350)
300 LN (300)
325 LN(325)
310 …

Same for the EXP or “e”.

Thank you, Jeff. Here’s a bit more clarity. Produce is an Input from the user. Each row will have to be calculated like the excel screencap. I was able to use the “Excel Formula” option but I was only able to perform the task on a single value. I’m new to this, would using a java script be better?

Produce LN (Produce)
346 5.84643878
357 5.87773578
321 5.77144112
204 5.31811999
210 5.34710753
234 5.45532112
126 4.83628191
130 4.86753445
120 4.78749174

Not sure why it’s “only able to perform the task on a single value”? If you add a column like Jeff or Dilon showed, wouldn’t it apply to every row? Can you add a screenshot?

1 Like

Perfect Timing! I just figured it out. I wasn’t referencing the column properly. Thank you

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.