LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default interesting interpolation


Rats, I was afraid it would be more complicated than the sample data set
indicated.

I'm not real good with Excel's built in lookup functions, but I expect
someone out there can figure out a combination of VLOOKUP, HLOOKUP,
INDEX, MATCH, etc. that will extract the desired boundary points. If
they do, I expect it will be a complex, ugly looking function.

If it were me, I'd probably build a UDF to handle this scenario.
Something like:

Function 2DLINTERP(lookuptable as range, newA as double, newB as
double) as double
rowA=0
'loop through rows to locate the interval containing newA
Do
rowA=rowA+1
loop until lookuptable.cells(rowA,1).value = newA
colB=0
'loop through columns to locate interval containing newB
Do
colB=colB+1
loop until lookuptable.cells(1,colB).value = newB
'now boundary points are located in lookuptable.cells(rowA-1,colB-1)
through lookuptable.cells(rowA,colB)
2DLINTERP=interpolation formula
end function

Note that this function assumes that A and B are sorted in ascending
order, and doesn't have any code to deal with cases where newA or newB
are outside the range of A or B. I'll let you decide how to deal with
those cases. I haven't tested it either, so it will probably need some
debugging.

That should be a start for you.


--
MrShorty
------------------------------------------------------------------------
MrShorty's Profile: http://www.excelforum.com/member.php...o&userid=22181
View this thread: http://www.excelforum.com/showthread...hreadid=472841

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Interpolation? Mel Excel Worksheet Functions 1 June 1st 10 04:09 PM
interpolation atatari Excel Discussion (Misc queries) 0 February 13th 06 03:49 AM
Interpolation teen New Users to Excel 3 December 22nd 05 03:47 PM
help with interpolation and limit of interpolation uriel78 Excel Discussion (Misc queries) 0 February 17th 05 04:27 PM
Here's an interesting one... Andrew Slentz Excel Programming 1 May 5th 04 09:30 PM


All times are GMT +1. The time now is 12:02 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"