How to find the formula within an oscillating data patern?


New Member
Jul 19, 2019

I have a large pool of data and if I graph the data i can see an oscillating patern. How can I let Excel find the oscillating formula?



Some videos you may like

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce

Eric W

MrExcel MVP
Aug 18, 2015
Welcome to the Board.

Hard to say without seeing your data. Curve-fitting is inherently tricky. You say that you have an oscillating pattern. This suggests a SIN function. The general formula of a sine is:

y = a*SIN(b*x+c)+d

You could set up a formula with those 4 coefficients in cells A1:A4 (for example). Then copy the formula down the rows where your data is, using the x value from your data. Then have another formula next to that formula which has the square of the difference between the original y value and the calculated y value from your formula. Finally, have one final formula that sums up the sum of the squares.

Now set up the Solver. You can either Google how to do that, or come back here and ask. But the gist of it is to set up the Solver so that it calculates what the minimum value of your sum of squares cell is, by varying the A1:A4 values.

But all this is just an outline, it could be much trickier. You might need to worry about converting your values to radians. The formula might be something weird like SIN(x)*COS(x)+SIN(a*x^2+b*x+c). There could be a lot of analysis involved. Things like knowing what the data represents could help. Good luck!

Watch MrExcel Video

Forum statistics

Latest member
Faceless Judge

This Week's Hot Topics

  • Timer in VBA - Stop, Start, Pause and Reset
    [CODE=vba][/CODE] Option Explicit Dim CmdStop As Boolean Dim Paused As Boolean Dim Start Dim TimerValue As Date Dim pausedTime As Date Sub...
  • how to updates multiple rows in muliselect listbox
    Hello everyone. I need help with below code. code is only chaning 1st row in mulitiselect list box. i know issue with code...
  • Delete Row from Table
    I am trying to delete a row from a table using VBA using a named range to find what I need to delete. My Range is finding the right cell. In the...
  • Assigning to a variable
    I have a for each block where I want to assign the value in column 5 of the found row to the variable Serv. [CODE=vba] For Each ws In...
  • Way to verify information
    Hi All, I don't know what to call this formula, and therefore can't search. I have a spreadsheet with information I want to reference...
  • Active Cell Address – Inactive Sheet
    How to use VBA to get the cell address of the active cell in an inactive worksheet and then place that cell address in a location on the current...