Cannot use Linest Fn with blanks in it

93arpan

New Member
Joined
Aug 21, 2023
Messages
6
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
Hi Everyone.

I'm working on this complex formula (that's what I think, I know for some of the individuals it will be easy)

=((INDEX(LINEST($N$4:$N$19,LN($O$4:$O$19),TRUE,FALSE),1))*(LN(O4)))+INDEX(LINEST($N$4:$N$19,LN($O$4:$O$19),TRUE,FALSE),2)
Customers (Column L)Category (Column M)Avg. NPP (Column N)Qty in KG (Column O)Demand Curve (Column P) -Formula
C1Low7.1765.07.76
C2Low2.32,655.07.64
C3Medium8.429,205.07.42
C4Medium8.71,140.07.72
C5Medium8.6240.07.87
C6Medium8.8765.07.76
C7Medium8.6765.07.76
C8Medium8.8300.07.85
C9Medium9.41,530.07.70
C10Medium3.7765.07.76
C11Medium7.51,530.07.70
C12Low8.33,825.07.61
C13High8.5765.07.76
C14High8.51,155.07.72
C15High8.12,805.07.64
C16Transactional8.09,945.07.52

Using the above formula I can calculate the demand curve in the last column.

However, if there's a blank value in between I get a 'Value Error' as shown below.
Customers (Column L)Category (Column M)Avg. NPP (Column N)Qty in KG (Column O)Demand Curve (Column P) -Formula
C1Low7.1765.0
#VALUE!​
C2Low
#VALUE!​
C3Medium8.429,205.0
#VALUE!​
C4Medium8.71,140.0
#VALUE!​
C5Medium8.6240.0
#VALUE!​
C6Medium8.8765.0
#VALUE!​
C7Medium8.6765.0
#VALUE!​
C8Medium8.8300.0
#VALUE!​
C9Medium9.41,530.0
#VALUE!​
C10Medium3.7765.0
#VALUE!​
C11Medium7.51,530.0
#VALUE!​
C12Low8.33,825.0
#VALUE!​
C13High8.5765.0
#VALUE!​
C14High8.51,155.0
#VALUE!​
C15High8.12,805.0
#VALUE!​
C16Transactional8.09,945.0
#VALUE!​

Can anyone please help me, how I can fix this issue or make this formula work in excel so that it can give me values despite there are blank values.

Thanks in advance
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Welcome to the MrExcel forum!

The values I get are not exactly what your example shows, but try this:

Book1
LMNOP
3Customers (Column L)Category (Column M)Avg. NPP (Column N)Qty in KG (Column O)Demand Curve (Column P) -Formula
4C1Low7.17658.035343817
5C2Low 
6C3Medium8.429,205.008.220993456
7C4Medium8.71,140.008.055676769
8C5Medium8.62407.976255693
9C6Medium8.87658.035343817
10C7Medium8.67658.035343817
11C8Medium8.83007.98762967
12C9Medium9.41,530.008.070674617
13C10Medium3.77658.035343817
14C11Medium7.51,530.008.070674617
15C12Low8.33,825.008.117379394
16C13High8.57658.035343817
17C14High8.51,155.008.056343074
18C15High8.12,805.008.101570311
19C16Transactional89,945.008.166083312
Sheet1
Cell Formulas
RangeFormula
P4:P19P4=IFERROR(LET(a,FILTER($N$4:$O$19,($N$4:$N$19<>"")*($O$4:$O$19<>"")),b,LINEST(INDEX(a,0,1),LN(INDEX(a,0,2)),1,0),INDEX(b,1)*LN(O4)+INDEX(b,2)),"")
 
Upvote 1
Solution
Hi Eric,

Thank you very much for a prompt response. You're a legend, this formula totally works and I get the correct values (tested 5-6 times).
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,636
Latest member
laura12345

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