Showing posts with label excel statistics. Show all posts
Showing posts with label excel statistics. Show all posts

Thursday, January 27, 2011

VLOOKUP in Excel To FInd List Matches in 2 Steps and Then Remove Them

Using VLOOKUP In Excel

To Find List Matches

In 2 Steps

and Then Remove Them



If you are an Internet marketer, you already know the importance of list management skills. Nothing beats Excel as a platform to manipulate the data in your lists.

Here is a quick lesson on how to find matching records in 2 lists in just 2 steps using VLOOKUP. We will then show you how to quickly remove those matches from either of these lists, leaving you with the original list with all records that have no matches in the other list.

Finding Matches in 2 Lists Using VLOOKUP

Step 1 – Arrange the Lists Properly and Perform a VLOOKUP

Here are the 2 lists. Arrange them so that the larger list is on the left:




Now, perform your VLOOKUP. Type the formula shown below into cell D2 and copy it down to cell D9. The results of the VLOOKUP appear in cells D2 to D9. An explanation of this VLOOKUP is provided next.

Click on the Image To See Larger Version

 
Here is an explanation of each argument of the VLOOKUP function in this case:



Column D contains the results of the VLOOKUP. The actual contents of the cells in this column are the VLOOKUP formulas, not the values showing in the cells. We need to work with only the values that appear and not the formulas.


Step 2 - Copy and Sort the Values from VLOOKUP

To do this, copy the contents of the column and then paste only their values using Paste / Paste Special / Values as shown here:

Click on the Image To See Larger Version


Now that we have a column of values and not formulas, we can sort the column with the ordinary Sort function under the Data tab as follows:

Click on the Image To See Larger Version


The Matches in Both Lists

Here is the result of the Sort. Highlighted in yellow are the matches from both lists:



Removing the Matches From List 1.

Paste the matches at the bottom of List 1:




Sort List 1 to get this result:



Use an If-Then-Else statement to print any cells that do not have matches above or below them. If a cell above or below matches that cell, only a blank space (“ “) will be printed. The formula shown in cell Q4 can be copied in cells Q2 to Q13 to get the following result:

Click On Image To See Larger Version


The contents of the cells in column Q are actually formulas, not the numbers that appear in the cells that are the result of the calculation. We need to copy only those numerical values into a column so we can perform data operations on them.

Do this the same way it was done above. Copy the contents of cells Q2 to Q13 and paste them into a new column using Paste Special / Values to get the following result:

Click On Image To See Larger Version


Sorting these will give you the final List 1 (highlighted in yellow below) with all matches from List 2 removed:

Click On Image To See Larger Version


You could easily run the same removal procedure on List 2 to remove the matches from that list as well. If you did that, you would have 2 lists that had no matching records.




If you would like to create a link to this blog article, here is the link to copy for your convenience: Using VLOOKUP In Excel To Find and Remove Matches in 2 Lists

Using VLOOKUP In Excel To Remove Matches in 2 Lists
Please post any comments you have on this article. Your opinion is highly valued!

If You Like This, Then Share It...
Using VLOOKUP In Excel To Remove Matches in 2 Lists Using VLOOKUP In Excel To Remove Matches in 2 Lists Using VLOOKUP In Excel To Remove Matches in 2 Lists Using VLOOKUP In Excel To Remove Matches in 2 Lists Using VLOOKUP In Excel To Remove Matches in 2 Lists Using VLOOKUP In Excel To Remove Matches in 2 Lists Using VLOOKUP In Excel To Remove Matches in 2 Lists

Excel Master Series Blog Directory

Statistical Topics and Articles In Each Topic

Thursday, January 20, 2011

Using Excel Solver To Find Your Sales Curve

Using the Excel Solver

To Find Your Sales Curve


Excel Solver is one of the best and easiest curve-fitting devices in the world, if you know how to use it. The marketing manager will find the curve-fitting capability of the Excel Solver to be the perfect tool to create a predictive sales equation.

In this example we are going to show how to use the Excel Solver to calculate an equation which most closely describes the relationship between sales and number of ads being run. The purpose of this equation is to be able to predict the number of sales based upon the number of ads that will be run.


A marketing manager has collected this following data on the company’s sales vs. the number of ads that were running at different times.


Sales        Number of Ads Running

50             6700
55             7500
59             8700
62             8900
75             8800
95             10900
110           11200
125           11400
140           11500
180           12300

Here is an Excel scatter plot of that data:

Click On Image To See a Larger Version

We would like to create an equation from this data that allows us to predict the sales based upon the number of ads currently running.



The first step is to eyeball the data and estimate what general type of curve this graph probably is. In this case it appears to a graph the has a diminishing y value for an increasing x value. A formula for such a curve would have the general form:

Y = A1 + A2 * X**B1


Sales = A1 + A2 * (Number of Ads Running)**B1

We can use the Excel Solver to solve for A1, A2, and B1.
We need to arrange the data in a form that can be input into the Excel Solver as follows:
Click On Image To See a Larger Version

This table shows the arrangement of data and the calculations. Here we have created an Excel model based upon our model of:


Sales = A1 + A2 * (Number of Ads Running)B1


One example of this formula in action is explained for Cell E16. We are listing the variable that we are solving for (A1, A2, and B1) in cells B3 to B5. In Solver language, these solves that we are changing are called Decision Variables.


We have arbitrarily set our Decision Variables for:


A1 = 100

A2 = 100
B1 = 0.05


We now take the difference between the actual number of sales and the number of sales predicted by our model with our arbitrary settings for the Decision Variables. The square of each difference is taken and then all squares are summed up.

We are trying to find the settings for the Decision Variables that will minimize the sum of the squares of the differences. In other words, we are trying to find A1, A2, and B1 that will minimize the number in cell G13.

Once the Solver has been installed as an add-in (To add-in Solver: File / Options / Add-Ins / Manage / Excel Add-Ins / Go / Solver Add-In), you can access the Solver in Excel 2010 by: Data / Solver.

The following blank Solver dialogue box comes up:

Click On Image To See a Larger Version

The Solver dialogue box has the following 5 parameters that need to be set:

1) The Objective Cell – The is the target cell that we are either trying to maximize, minimize, or achieve a certain value.

2) Whether we want to minimize or maximize the target, or attempt to achieve a certain value in the Objective cell.

3) Decision Variables – A set of variables that will be changed by the Excel Solver in order to optimize the target cell.

4) Constraints – These are the limitations that the problem subjects the Solver to during its calculations


Once again, here is the data table for Solver inputs:

 Click On Image To See a Larger Version

Objective:

We are trying to minimize Cell G13, the sum of the square of differences between the actual and predicted sales.

Decision Variables:

We are changing A1, A2, and B1 (cells B3 to B5) to minimize our Objective, Cell G13. The Decision Variables are therefore Cells B3 to B5.

Constraints:
There are none for this curve-fitting operation.

Selection of Solving Method: GRG Nonlinear

The GRG Nonlinear method is used when the equation producing the objective is not linear but is smooth (continuous). Examples of smooth nonlinear functions are:
=1/C1, =Log(C1), and =C1^2

These functions have graphs that are curved (nonlinear), but have no breaks (smooth)

Our sales equation appears to be smooth and non-linear:

Sales = A1 + A2 * (Number of Ads Running)**B1

Here is the completed Solver dialogue box:

Click On Image To See a Larger Version

Here is a close-up of the Solver Objective, Decision Variables, and Contraints:

Click On Image To See a Larger Version

If we now hit the Solve button, we get the following result:

Click On Image To See a Larger Version

Solver has optimized the Decision Variables to minimize the objective function as follows:

A1 = -445,616
A2 = 437,247
B1 = 0.00911

The Objective is minimized to: 2,556,343

We can now create an Excel graph of the Actual Sales vs. the Predicted Sales as follows:


Click On Image To See a Larger Version

Solver calculates that Sales can be predicted from Number of Ads Runing bythe following equation:

Sales = -445616 + 437247 * (Number of Ads Running)**(.00911)

The trickiest part of this problem is the first step; eyeballing the data to determine what kind of graph the data is arranged in. You should take time to evaluate whether you are pursuing calculation of the correct curve type.

Solver Tips

You may notice that if you run this problem through the Solver multiple time, you will get slightly different answers. Each time that you run Solver’s GRG algorithm, it will calculate different values for the Decision Variables. You are trying to find the values for the Decision Variables that minimize the objective function (cell G13) the most.


When the Solver runs the GRG algorithm, it picks a starting point for its calculations. Each time you run the Solver GRG method a slightly different starting point will be picked. That is why different answers will appear during each run. Choose the Decision Variable value that occur during the run which produces the lowest value of the Objective. Keep running the Solver until the objective is not minimized anymore. That should give you the optimal values of the Decision Variables. That was done in the example above.

Initial Solver Settings:

Here are some Solver settings that you want to configure prior to running the Solver for most problems. These settings are found when you click the Options button:

Show Iteration Results: Leave this unchecked. This stops the GRG Solver after each iteration, displaying the result for that iteration. Very rarely is there a reason for doing that.

Use Atomatic Scaling: Leave this box unchecked. You would only use this option if you had reason to believe that inputs of the Solver were measured using different scales.

Assume Non-Negative: Only check this if you are sure that none of the variables can ever be negative. In this case, that is clearly not the case.

Bypass Solver Reports: Leave this box unchecked. There is no advantage to not having Solver reports for each Solver run.


Summary

Excel Solver is an easy-to-use and powerful curve fitting tools that can be used to find predictive sales equations for your company. It will work as long as you have properly determined the correct general curve type in the beginning.



If you would like to create a link to this blog article, here is the link to copy for your convenience: Using Excel Solver to Find Your Sales Equation

Using Excel Solver To Find Your Sales Curve
Please post any comments you have on this article. Your opinion is highly valued!

If You Like This, Then Share It...
Using Excel Solver To Find Your Sales Curve Using Excel Solver To Find Your Sales Curve Using Excel Solver To Find Your Sales Curve Using Excel Solver To Find Your Sales Curve Using Excel Solver To Find Your Sales Curve Using Excel Solver To Find Your Sales Curve Using Excel Solver To Find Your Sales Curve

Excel Master Series Blog Directory

Statistical Topics and Articles In Each Topic