Goal seek excel как использовать

If you know the result that you want from a formula, but are not sure what input value the formula needs to get that result, use the Goal Seek feature. For example, suppose that you need to borrow some money. You know how much money you want, how long you want to take to pay off the loan, and how much you can afford to pay each month. You can use Goal Seek to determine what interest rate you will need to secure in order to meet your loan goal.

If you know the result that you want from a formula, but are not sure what input value the formula needs to get that result, use the Goal Seek feature. For example, suppose that you need to borrow some money. You know how much money you want, how long you want to take to pay off the loan, and how much you can afford to pay each month. You can use Goal Seek to determine what interest rate you will need to secure in order to meet your loan goal.

Note: Goal Seek works only with one variable input value. If you want to accept more than one input value; for example, both the loan amount and the monthly payment amount for a loan, you use the Solver add-in. For more information, see Define and solve a problem by using Solver.

Step-by-step with an example

Let’s look at the preceding example, step-by-step.

Because you want to calculate the loan interest rate needed to meet your goal, you use the PMT function. The PMT function calculates a monthly payment amount. In this example, the monthly payment amount is the goal that you seek.

Prepare the worksheet

  1. Open a new, blank worksheet.

  2. First, add some labels in the first column to make it easier to read the worksheet.

    1. In cell A1, type Loan Amount.

    2. In cell A2, type Term in Months.

    3. In cell A3, type Interest Rate.

    4. In cell A4, type Payment.

  3. Next, add the values that you know.

    1. In cell B1, type 100000. This is the amount that you want to borrow.

    2. In cell B2, type 180. This is the number of months that you want to pay off the loan.

      Note: Although you know the payment amount that you want, you do not enter it as a value, because the payment amount is a result of the formula. Instead, you add the formula to the worksheet and specify the payment value at a later step, when you use Goal Seek.

  4. Next, add the formula for which you have a goal. For the example, use the PMT function:

    1. In cell B4, type =PMT(B3/12,B2,B1). This formula calculates the payment amount. In this example, you want to pay $900 each month. You don’t enter that amount here, because you want to use Goal Seek to determine the interest rate, and Goal Seek requires that you start with a formula.

      The formula refers to cells B1 and B2, which contain values that you specified in preceding steps. The formula also refers to cell B3, which is where you will specify that Goal Seek put the interest rate. The formula divides the value in B3 by 12 because you specified a monthly payment, and the PMT function assumes an annual interest rate.

      Because there is no value in cell B3, Excel assumes a 0% interest rate and, using the values in the example, returns a payment of $555.56. You can ignore that value for now.

Use Goal Seek to determine the interest rate

  1. On the Data tab, in the Data Tools group, click What-If Analysis, and then click Goal Seek.

  2. In the Set cell box, enter the reference for the cell that contains the formula that you want to resolve. In the example, this reference is cell B4.

  3. In the To value box, type the formula result that you want. In the example, this is -900. Note that this number is negative because it represents a payment.

  4. In the By changing cell box, enter the reference for the cell that contains the value that you want to adjust. In the example, this reference is cell B3.
     

    Note: The cell that Goal Seek changes must be referenced by the formula in the cell that you specified in the Set cell box.

  5. Click OK.

    Goal Seek runs and produces a result, as shown in the following illustration.

    Goal Seek

    Cells B1, B2, and B3 are the values for the loan amount, term length, and interest rate.

    Cell B4 displays the result of the formula =PMT(B3/12,B2,B1).

  6. Finally, format the target cell (B3) so that it displays the result as a percentage.

    1. On the Home tab, in the Number group, click Percentage.

    2. Click Increase Decimal or Decrease Decimal to set the number of decimal places.

If you know the result that you want from a formula, but are not sure what input value the formula needs to get that result, use the Goal Seek feature. For example, suppose that you need to borrow some money. You know how much money you want, how long you want to take to pay off the loan, and how much you can afford to pay each month. You can use Goal Seek to determine what interest rate you will need to secure in order to meet your loan goal.

Note: Goal Seek works only with one variable input value. If you want to accept more than one input value, for example, both the loan amount and the monthly payment amount for a loan, use the Solver add-in. For more information, see Define and solve a problem by using Solver.

Step-by-step with an example

Let’s look at the preceding example, step-by-step.

Because you want to calculate the loan interest rate needed to meet your goal, you use the PMT function. The PMT function calculates a monthly payment amount. In this example, the monthly payment amount is the goal that you seek.

Prepare the worksheet

  1. Open a new, blank worksheet.

  2. First, add some labels in the first column to make it easier to read the worksheet.

    1. In cell A1, type Loan Amount.

    2. In cell A2, type Term in Months.

    3. In cell A3, type Interest Rate.

    4. In cell A4, type Payment.

  3. Next, add the values that you know.

    1. In cell B1, type 100000. This is the amount that you want to borrow.

    2. In cell B2, type 180. This is the number of months that you want to pay off the loan.

      Note: Although you know the payment amount that you want, you do not enter it as a value, because the payment amount is a result of the formula. Instead, you add the formula to the worksheet and specify the payment value at a later step, when you use Goal Seek.

  4. Next, add the formula for which you have a goal. For the example, use the PMT function:

    1. In cell B4, type =PMT(B3/12,B2,B1). This formula calculates the payment amount. In this example, you want to pay $900 each month. You don’t enter that amount here, because you want to use Goal Seek to determine the interest rate, and Goal Seek requires that you start with a formula.

      The formula refers to cells B1 and B2, which contain values that you specified in preceding steps. The formula also refers to cell B3, which is where you will specify that Goal Seek put the interest rate. The formula divides the value in B3 by 12 because you specified a monthly payment, and the PMT function assumes an annual interest rate.

      Because there is no value in cell B3, Excel assumes a 0% interest rate and, using the values in the example, returns a payment of $555.56. You can ignore that value for now.

Use Goal Seek to determine the interest rate

  1. Do one of the following:

    In Excel 2016 for Mac: On the Data tab, click What-If Analysis, and then click Goal Seek.

    In Excel for Mac 2011: On the Data tab, in the Data Tools group, click What-If Analysis, and then click Goal Seek.

  2. In the Set cell box, enter the reference for the cell that contains the formula that you want to resolve. In the example, this reference is cell B4.

  3. In the To value box, type the formula result that you want. In the example, this is -900. Note that this number is negative because it represents a payment.

  4. In the By changing cell box, enter the reference for the cell that contains the value that you want to adjust. In the example, this reference is cell B3.
     

    Note: The cell that Goal Seek changes must be referenced by the formula in the cell that you specified in the Set cell box.

  5. Click OK.

    Goal Seek runs and produces a result, as shown in the following illustration.

    What-if analysis - Goal Seek feature

  6. Finally, format the target cell (B3) so that it displays the result as a percentage. Follow one of these steps:

    • In Excel 2016 for Mac: On the Home tab, click Increase Decimal Increase Decimal or Decrease Decimal Decrease Decimal.

    • In Excel for Mac 2011: On the Home tab, under Number group, click Increase Decimal Increase the number of decimal places or Decrease Decimal Decrease the number of decimal places to set the number of decimal places.

Подбор параметра в Microsoft Excel

Очень полезной функцией в программе Microsoft Excel является Подбор параметра. Но, далеко не каждый пользователь знает о возможностях данного инструмента. С его помощью, можно подобрать исходное значение, отталкиваясь от конечного результата, которого нужно достичь. Давайте выясним, как можно использовать функцию подбора параметра в Microsoft Excel.

Суть функции

Если упрощенно говорить о сути функции Подбор параметра, то она заключается в том, что пользователь, может вычислить необходимые исходные данные для достижения конкретного результата. Эта функция похожа на инструмент Поиск решения, но является более упрощенным вариантом. Её можно использовать только в одиночных формулах, то есть для вычисления в каждой отдельной ячейке нужно запускать всякий раз данный инструмент заново. Кроме того, функция подбора параметра может оперировать только одним вводным, и одним искомым значением, что говорит о ней, как об инструменте с ограниченным функционалом.

Применение функции на практике

Для того, чтобы понять, как работает данная функция, лучше всего объяснить её суть на практическом примере. Мы будем объяснять работу инструмента на примере программы Microsoft Excel 2010, но алгоритм действий практически идентичен и в более поздних версиях этой программы, и в версии 2007 года.

Имеем таблицу выплат заработной платы и премии работникам предприятия. Известны только премии работников. Например, премия одного из них — Николаева А. Д, составляет 6035,68 рублей. Также, известно, что премия рассчитывается путем умножения заработной платы на коэффициент 0,28. Нам предстоит найти заработную плату работников.

Таблица заработной платы в Microsoft Excel

Для того, чтобы запустить функцию, находясь во вкладке «Данные», жмем на кнопку «Анализ «что если»», которая расположена в блоке инструментов «Работа с данными» на ленте. Появляется меню, в котором нужно выбрать пункт «Подбор параметра…».

Переход к подбору параметра в Microsoft Excel

После этого, открывается окно подбора параметра. В поле «Установить в ячейке» нужно указать ее адрес, содержащей известные нам конечные данные, под которые мы будем подгонять расчет. В данном случае, это ячейка, где установлена премия работника Николаева. Адрес можно указать вручную, вбив его координаты в соответствующее поле. Если вы затрудняетесь, это сделать, или считаете неудобным, то просто кликните по нужной ячейке, и адрес будет вписан в поле.

В поле «Значение» требуется указать конкретное значение премии. В нашем случае, это будет 6035,68. В поле «Изменяя значения ячейки» вписываем ее адрес, содержащей исходные данные, которые нам нужно рассчитать, то есть сумму зарплаты работника. Это можно сделать теми же способами, о которых мы говорили выше: вбить координаты вручную, или кликнуть по соответствующей ячейке.

Когда все данные окна параметров заполнены, жмем на кнопку «OK».

Окно подбора параметра в Microsoft Excel

После этого, совершается расчет, и в ячейки вписываются подобранные значения, о чем сообщает специальное информационное окно.

Результат подбора парамеров в Microsoft Excel

Подобную операцию можно проделать и для других строк таблицы, если известна величина премии остальных сотрудников предприятия.

Lumpics.ru

Решение уравнений

Кроме того, хотя это и не является профильной возможностью данной функции, её можно использовать для решения уравнений. Правда, инструмент подбора параметра можно с успехом использовать только относительно уравнений с одним неизвестным.

Допустим, имеем уравнение: 15x+18x=46. Записываем его левую часть, как формулу, в одну из ячеек. Как и для любой формулы в Экселе, перед уравнением ставим знак «=». Но, при этом, вместо знака x устанавливаем адрес ячейки, куда будет выводиться результат искомого значения.

В нашем случае, формулу мы запишем в C2, а искомое значение будет выводиться в B2. Таким образом, запись в ячейке C2 будет иметь следующий вид: «=15*B2+18*B2».

Уравнение в Microsoft Excel

Запускаем функцию тем же способом, как было описано выше, то есть, нажав на кнопку «Анализ «что если»» на ленте», и перейдя по пункту «Подбор параметра…».

Переход к подбору параметра для уравнения в Microsoft Excel

В открывшемся окне подбора параметра, в поле «Установить в ячейке» указываем адрес, по которому мы записали уравнение (C2). В поле «Значение» вписываем число 45, так как мы помним, что уравнение выглядит следующим образом: 15x+18x=46. В поле «Изменяя значения ячейки» мы указываем адрес, куда будет выводиться значение x, то есть, собственно, решение уравнения (B2). После того, как мы ввели эти данные, жмем на кнопку «OK».

Подбор параметра для уравнения в Microsoft Excel

Как видим, программа Microsoft Excel успешно решила уравнение. Значение x будет равно 1,39 в периоде.

Решение уравнения в Microsoft Excel

Изучив инструмент Подбор параметра, мы выяснили, что это довольно простая, но вместе с тем полезная и удобная функция для поиска неизвестного числа. Её можно использовать как для табличных вычислений, так и для решения уравнений с одним неизвестным. Вместе с тем, по функционалу она уступает более мощному инструменту Поиск решения.

Got the output for a formula but don’t know the input? Back-solving with Goal Seek might be just what you need.

Excel on a background.

Excel’s What-If Analysis allows you to see how changing a cell can affect a formula’s output. You can use Excel’s tools for this purpose to calculate the effect of changing the value of a cell in a formula.

Excel has three types of What-If Analysis tools: Scenario Manager, Goal Seek, and Data Table. With Goal Seek, you can determine what input you need to convert the formula backward to a certain output.

The Goal Seek feature in Excel is trial and error, so if it does not produce what you want, then Excel works on improving that value until it does.

What Are Excel Goal Seek Formulas?

Goal Seek in Excel essentially breaks down into three major components:

  1. Set cell: The cell you want to use as your goal.
  2. To value: The value you want as your goal.
  3. By changing cell: The cell you would like to change to reach your goal value.

With these three settings set, Excel will attempt to improve the value in the cell you set in By changing cell until the cell you set in Set cell reaches the value you determined in To value.

If all that sounds confusing, the examples below will give you a good idea of how Goal Seek works.

Goal Seek Example 1

For instance, let’s say you have two cells (A & B) and a third cell that calculates the average of these two.

Now suppose you have a static value for A, and you wish to raise the average level by changing the value for B. By using Goal Seek, you can calculate what value of B will produce the average you want.

How to Use Goal Seek in Excel

  1. In Excel, click cell C1.
  2. In the formula bar, enter the following code:
     =AVERAGE(A1:B1) 

    This formula will have Excel calculate the average of the values in cells A1 and B1 and output that in cell C1. You can make sure your formula works by inputting numbers in A1 and B1. C1 should show their average.

  3. For this example, change the value of the A1 cell to 16.
  4. Select cell C1, and then from the ribbon, go to the Data tab.
  5. Under the Data tab, select What-If Analysis and then Goal Seek. This will bring up the Goal Seek window.
  6. In the Goal Seek window, set the Set cell to C1. This will be your goal cell. Having highlighted C1 before opening the Goal Seek window will automatically set it in Set cell.
  7. In To value, insert the goal value you want. For this example, we want our average to be 26, so the goal value will be 26 as well.
  8. Finally, in the By changing cell, select the cell you want to change to reach the goal. In this example, this will be cell B2.
  9. Click OK to have Goal Seek work its magic.

The Goal Seek Window In Excel Has Three Main Components.

Once you click OK, a dialogue will appear informing you that Goal Seek has found a solution.

The value of cell A1 will change to the solution, and this will overwrite the previous data. It’s a good idea to run Goal Seek on a copy of your datasheet to avoid losing your original data.

Goal Seek Example 2

Goal Seek can be useful when you utilize it in real-life scenarios. However, to use Goal Seek to its full potential, you need to have a proper formula in place, to begin with.

For this example, let’s take a small banking case. Suppose that you have a bank account that gives you a 4% annual interest on the money you have in your account.

Using What-If Analysis and Goal Seek, you can calculate how much money you need to have in your account to get a certain amount of monthly interest payment.

For this example, let’s say we want to get $350 every month from interest payments. Here’s how you can calculate that:

  1. In cell A1 type Balance.
  2. In cell A2 type Annual Rate.
  3. In cell A4 type Monthly Profit.
  4. In cell B2 type 4%.
  5. Select cell B4 and in the formula bar, enter the formula below:
     =B1*B2/12 

    The monthly profit will equal the account balance multiplied by the annual rate and then divided by the number of months in a year, 12 months.

  6. Go to the Data tab, click on What-If Analysis, and then select Goal Seek.
  7. In the Goal Seek window, type B4 in Set cell.
  8. Type 350 in the To value cell. (This is the monthly profit you want to get)
  9. Type B1 in By changing cell. (This will change the balance to a value that will yield $350 monthly)
  10. Click OK. The Goal Seek Status dialogue will pop up.

The Goal Seek Status dialogue will let you know if Goal Seek was successful.

In the Goal Seeking Status dialog, you’ll see that Goal Seeking has found a solution in cell B4. In cell B1, you can see the solution, which should be 105,000.

Goal Seek Requirements

With Goal Seek, you can see that it can change only one cell to reach the goal value. This means that Goal Seek cannot solve and reach a solution if it has more than one variable.

In Excel, you can still solve for more than one variable, but you’ll need to use another tool called the Solver. You can read more about Excel’s Solver by reading our article on How To Use Excel’s Solver.

Goal Seek Limitations

A Goal Seek formula uses the trial-and-improvement process to reach the optimal value, which can pose some problems when the formula produces an undefined value. Here’s how you can test it yourself:

  1. In cell A1, type 3.
  2. Select cell C1, then in the formula bar enter the formula below:
     =1/(A1-5) 

    This formula will divide one by A1-5, and if A1-5 happens to be 0, the result will be an undefined value.

  3. Go to the Data tab, click What-If Analysis and then select Goal Seek.
  4. In Set cell, type C1.
  5. In To value, type 1.
  6. Finally, in By changing cell type A1. (This will change the A1 value to reach 1 in C1)
  7. Click OK.

Goal Seek doesn't always work.

The Goal Seek Status dialogue box will tell you that it may not have found a solution, and you can double-check that the A1 value is way off.

Now, the solution to this Goal Seek would be to simply have 6 in A1. This will give 1/1, which equals 1. But at one point during the trial and improvement process, Excel tries 5 in A1, which gives 1/0, which is undefined, killing the process.

A way around this Goal Seek problem is to have a different starting value, one that can evade the undefined in the trial and improvement process.

As an example, if you change A1 to any number greater than 5 and then repeat the same steps to Goal Seek for 1, you should get the correct result.

Make the Calculations More Efficient With Goal Seek

What-If Analysis and Goal Seek can speed up your calculations with your formulas by a great measure. Learning the right formulas is another important step toward becoming an excel master.

  • Поиск цели в VBA

Поиск цели в VBA

Поиск цели в VBA — это процесс, с помощью которого мы можем достичь цели, которой хотим достичь. Это процесс, который показывает, сколько нам нужно сделать, чтобы достичь целевого набора. Предположим, поезд прибывает ежедневно в 10 часов утра. Поезд курсирует с понедельника по пятницу между А и В. И, учитывая, что среднее время прибытия этого поезда из А в В составляет ровно 10 часов утра без каких-либо задержек. Таким образом, если следующее время прибытия этого поезда — 10:16, 10:01, 9:57, 10:04 в течение 4 дней подряд с понедельника по четверг. И чтобы поддерживать среднее время 10:00, которое является целью, установленной для этого поезда, оно должно прибыть в 9:45, просто чтобы поддерживать среднее время прибытия в 10:00. Это может быть даже круче, если у нас есть что автоматизировать. Приходит VBA Goal Seek .

Синтаксис для поиска цели:

Ниже приведен синтаксис поиска цели VBA.

Где,

  • Диапазон: Целевая ячейка диапазона, которая содержит текущий предел.
  • Цель : предел или цель, которую мы хотим достичь.
  • Смена ячейки: ячейка, в которой мы увидим требуемый предел, который будет достигнут.

Как использовать поиск цели в Excel VBA?

Мы узнаем, как использовать поиск цели в Excel с помощью кода VBA.

Вы можете скачать этот шаблон Excel для поиска целей VBA здесь — Шаблон Excel для поиска целей VBA

VBA Goal Seek — Пример № 1

Средняя точность, которую сотрудники должны поддерживать на 95% в неделю. Ниже мы располагаем данными о точности работника с понедельника по четверг со средней точностью 92, 25%, которая указана в ячейке C8, как показано ниже.

Теперь, согласно синтаксису Goal Seek, у нас есть ячейка Range, в которой есть текущее значение для подачи и Target value, то есть средняя точность 90%, которая должна быть достигнута этим сотрудником.

В этом примере, где точность работы сотрудника находится под контролем. Для этого выполните следующие шаги:

Шаг 1. Откройте модуль на вкладке меню «Вставка», как показано ниже.

Шаг 2: Теперь напишите процедуру процедуры поиска цели VBA, как показано ниже. Мы можем выбрать любое имя, чтобы определить это.

Код:

 Sub Goal_Seek () End Sub 

Шаг 3: В соответствии с синтаксисом, мы выберем ячейку Range, которая содержит текущее среднее значение для подачи. Вот эта ячейка С8.

Код:

 Диапазон Sub Goal_Seek () ("C8"). End Sub 

Шаг 4: Теперь выберите функцию «Поиск цели» и в соответствии с синтаксисом выберите целевое значение, которого нам нужно достичь. Здесь эта цель на 90% точна.

Код:

 Sub Goal_Seek () Range ("C8"). GoalSeek Goal: = 90 End Sub 

Шаг 5: Теперь, наконец, выберите диапазон этой ячейки, где мы должны увидеть требуемую точность, которая должна быть достигнута. Вот эта ячейка C6 со ссылкой на пятницу.

Код:

 Sub Goal_Seek () Range ("C8"). GoalSeek Goal: = 90, ChangingCell: = Range ("C6") End Sub 

Шаг 6: Теперь, когда все сделано, мы скомпилируем код и запустим его. Мы увидим, что ячейка C6 имеет значение «Изменяющаяся ячейка», равное 81. Это означает, что если этому сотруднику удалось достичь даже 81% точности в пятницу, то он легко сможет достичь точности 90%.

VBA Goal Seek — Пример № 2

В этом примере у нас есть данные о времени поворота (TAT или время выполнения задания) какого-либо сотрудника команды, выполняющего одну и ту же задачу каждый день. 5 сотрудников выполняют одинаковую работу с понедельника по пятницу. Заданное время для завершения этого действия составляет 50 минут. И нам нужно выяснить, сколько времени требуется каждому сотруднику, чтобы поддерживать среднее время завершения 50 минут или меньше. Для этого выполните следующие шаги:

Шаг 1: В модуле напишите подпроцедуру для поиска цели VBA, как показано ниже.

Код:

 Sub Goal_Seek2 () End Sub 

Шаг 2: Определите переменную, по которой мы можем рассчитывать, откуда мы должны начать поиск цели как Лонг.

Код:

 Sub Goal_Seek2 () Dim A As Long End Sub 

Шаг 3: Теперь снова определите еще 2 переменные, используя DIM с типом данных Range . Первый будет использоваться для отслеживания текущего итогового среднего, а второй будет использоваться для связывания эталонной ячейки, в которой мы хотим получить результат.

Код:

 Sub Goal_Seek2 () Dim A As Long Dim FinalAvg в качестве эталона яркости диапазона в качестве Sub End 

Шаг 4: Определите другую переменную как Integer, чтобы установить цель, которую мы хотим достичь.

Код:

 Sub Goal_Seek2 () Dim A As Long Dim FinalAvg в качестве эталона Dim диапазона в качестве цели Dim диапазона в качестве целочисленного Sub Sub 

Шаг 5: Здесь наша цель — 50 минут, поэтому установите переменную Target с этим значением.

Код:

 Sub Goal_Seek2 () Dim A As Long Dim FinalAvg в качестве эталона Dim диапазона в качестве цели Dim диапазона в качестве цели Integer = 50 End Sub 

Шаг 6: Откройте цикл For-Next, как показано ниже.

Код:

 Sub Goal_Seek2 () Dim A As Long Dim FinalAvg в качестве эталона Dim диапазона в качестве цели Dim диапазона в качестве цели Integer = 50 для следующего A Sub Sub 

Шаг 7: Теперь выберите диапазон тех ячеек, которые имеют значения. Здесь эти строки от 3 до 7 чисел.

Код:

 Sub Goal_Seek2 () Dim A As Long Dim FinalAvg в качестве эталона Dim диапазона в качестве цели Dim диапазона в качестве цели Integer = 50 для A = от 3 до 7 Next A End Sub 

Шаг 8: Установите окончательное среднее значение, откуда мы хотим получить. Вот эта ячейка в строке 9.

Код:

 Sub Goal_Seek2 () Dim A As Long Dim FinalAvg в качестве ссылки Dim диапазона в качестве цели Dim Range в качестве цели Integer = 50 Для A = от 3 до 7 Установите FinalAvg = Cells (9, A) Далее A End Sub 

Шаг 9: Аналогичным образом установите диапазон опорных ячеек, где мы хотим видеть значение поиска цели для достижения цели, и эта строка ячеек равна 7.

Код:

 Sub Goal_Seek2 () Dim A As Long Dim FinalAvg в качестве эталона Dim диапазона в качестве цели Dim диапазона в качестве целочисленной цели = 50 для A = от 3 до 7 Установить FinalAvg = Cells (9, A) Установить эталон = Cells (7, A) Next A End Sub 

Шаг 10: Наконец, примените VBA Seal Seek с правильным синтаксисом, как показано ниже.

Код:

 Sub Goal_Seek2 () Dim A As Long Dim FinalAvg в качестве задания Dim для диапазона в качестве цели Dim для диапазона в качестве цели Integer = 50 Для A = от 3 до 7 Установить FinalAvg = Cells (9, A) Установить ссылку = Cells (7, A) FinalAvg.GoalSeek Target, Reference Next A End Sub 

Шаг 11: Теперь скомпилируйте полный код, нажав функциональную клавишу F8, и запустите после этого, если ошибки не обнаружены.

Мы увидим, что в строке 7 с помощью «Поиск цели» мы получим время в минутах, которое каждый сотрудник должен достичь в пятницу, чтобы поддерживать в среднем 50 минут или меньше.

Так работает VBA Goal Seek.

Преимущества Excel VBA Поиск цели

  • VBA Goal Seek весьма полезен для отслеживания производительности различными способами.
  • Это также может быть использовано во многих статистических работах, где нам нужно отслеживать и нацеливать предел данных, которого мы хотим достичь.
  • Это говорит о точной ценности, которую человек должен достичь, чтобы достичь цели.

То, что нужно запомнить

  • Это можно использовать как в Excel, так и в VBA.
  • Ячейка результата со средней или другой функцией всегда должна иметь формулу.
  • Мы можем ввести целевое значение в Goal в синтаксисе Goal Seek, иначе мы можем определить это и раньше отдельно.
  • Мы можем изменить и обновить целевое значение в соответствии с нашими потребностями и требованиями.
  • Эта задача не может быть выполнена путем записи макроса, доступного на вкладке разработчика.
  • После этого не забудьте сохранить файл Excel в формате макроса, чтобы сохранить записанный код.

Рекомендуемая статья

Это руководство по поиску целей VBA. Здесь мы обсудим, как использовать Goal Seek в Excel VBA вместе с практическими примерами и загружаемым шаблоном Excel. Вы также можете просмотреть наши другие предлагаемые статьи —

  1. Коллекция VBA (Примеры)
  2. VBA IF Заявления | Шаблоны Excel
  3. Как использовать функцию сортировки Excel VBA?
  4. VBA While Loop (Примеры с шаблоном Excel)
  5. VBA Environ Function

What is Goal Seek in Excel?

The Goal Seek in excel is a “what-if-analysis” tool that calculates the value of the input cell (variable) with respect to the desired outcome. In other words, the tool helps answer the question, “what should be the value of the input in order to attain the given output?”

For example, the cost price of a product is $15 and the business wants to earn revenue of $50,000. The Goal Seek function can determine the number of units of the product to be sold to achieve the given target of $50,000.

The Goal Seek changes the variable (cause) to study the variations in the result (effect). It shows the impact of change in one value on the other value. This is why it is helpful in cause and effect analysis.

Goal seek function in excel is used in financial modeling and forecasting scenarios.

Table of contents
  • What is Goal Seek in Excel?
    • Goal Seek Parameters
    • How to use Goal Seek in Excel?
      • Example #1
      • Example #2
      • Example #3
    • The Rules Governing the Parameters
    • Frequently Asked Questions
    • Recommended Articles

Goal Seek Parameters

The parameters to be specified in the “Goal Seek” dialog box are stated as follows:

  • Set cell–In this box, enter the cell reference of the formula to be resolved. This is the target cell or the formula cell.
  • To value–In this box, enter the desired output to be achieved. This is the value of the “set cell” to be attained.
  • By changing cell–In this box, enter the reference of the input cell (variable) to be adjusted. This is the cell we want to change in order to impact the “set cell.”

Note: At a given time, Goal Seek works with only one variable input. For working with multiple input values, use the solver in Excel.

Goal Seek in Excel

How to use Goal Seek in Excel?

Example #1

You can download this Goal Seek Excel Template here – Goal Seek Excel Template

The following table shows the votes received by the two candidates, A and B, who contested in an election. In the present situation, candidate B is leading by 10,000 votes. It is given that to win the election, 50.01% votes are required.

We want to change the voting percentage (column C) of candidate A in such a way that he wins the election. Calculate the total number of votes required by candidate A to win.

Goal Seek Excel Example 1

Let us calculate the present voting percentage for both the candidates. This is done by dividing the individual votes received by the total votes.

Candidate A has won 46.43% of the total votes. Therefore, he needs only 3.67% votes to win the election.

Goal Seek Excel Example 1-1

The steps to use Goal Seek in excel are stated as follows:

  1. In the Data tab, click “Goal Seek” from the “what-if-analysis” drop-down.

    Goal Seek Excel Example 1-2

  2. The “Goal Seek” excel window appears as shown in the following image.

    Goal Seek Excel Example 1-3

  3. Enter $C$2 in the “set cell” box. This is because C2 is the target cell.

    Goal Seek Excel Example 1-4

  4. Enter 50.01% in the “to value” box. This is the value of the “set cell” that we want to obtain. In other words, the “set cell” should change to the target value of 50.01%.

    Goal Seek Excel Example 1-5

  5. Enter $B$2 in the “by changing cell” box. This is the cell we want to change to impact the “set cell” C2. Since all the parameters are set, click “Ok” to get the result.

    Goal Seek Excel Example 1-6

  6. The output is shown in the following image. Candidate A should secure 70,014 votes to win the election. With 70,014 votes, the voting percentage of candidate A will become 50.01%. Click “Ok” to apply the changes.

    Goal Seek Excel Example 1-7

    The total number of votes and the voting percentage of candidate A has changed. Consequently, the votes and the voting percentage of candidate B also changes.

    The votes of candidate B are calculated by subtracting 70,014 from 140,000. The final output is displayed in the following image. Hence, candidate A wins the election.

Example #2

Mr. A opens a retail shop and sells goods at an average selling price of $25 per unit. To meet his operating expenses, he wants to generate monthly revenue of $250,000.

We want to calculate the quantity of the goods Mr. A should sell to earn the given revenue.

Goal Seek Excel Example 2

Step 1: In cell B3, apply the formula unit priceUnit Price is a measurement used for indicating the price of particular goods or services to be exchanged with customers or consumers for money. It includes fixed costs, variable costs, overheads, direct labour, and a profit margin for the organization.read more*units (B1*B2).

Goal Seek Excel Example 2-1

Step 2: In the Data tab, click “Goal Seek” from the “what-if-analysis” drop-down. The “Goal Seek” window appears as shown in the following image.

Goal Seek Excel Example 2-2

Step 3: Enter $B$3 in the “set cell” box. The target cell is the revenue cell B3.

Goal Seek Excel Example 2-3

Step 4: Enter 250000 in the “to value” box. This is the value of the “set cell” to be achieved.

Goal Seek Excel Example 2-4

Step 5: Enter $B$2 in the “by changing cell.” The quantity has to be calculated in cell B2. So, this is the cell that has to be adjusted to achieve the given revenue. Click “Ok.”

Goal Seek Excel Example 2-5

Step 6: The output is displayed in the following image. Hence, Mr. A needs to sell 10,000 units of goods to generate revenue of $250,000. Click “Ok” to apply the changes.

Goal Seek Excel Example 2-6

Example #3

The following table shows the marks obtained (in percentage) by a student in five subjects. Her present average grade is 88%. Since there are six subjects in the class, she is yet to appear for the last examination.

The student is targeting the overall average of 90% from all the six subjects. We want to calculate the marks she should score in the remaining subject to secure the given average.

Example 3

Step 1: Open the “Goal Seek” window from the Data tab.

Example 3-1

Step 2: Enter $B$7 as the “set cell.” The target cell is the average cell B7.

Example 3-2

Step 3: Enter “90” in the “to value” box. This is the value we want to attain.

Example 3-3

Step 4: Enter $B$6 in the “by changing cell” box. This is the value that has to be adjusted. Click “Ok.”

Example 3-4

Step 5: The output is displayed in the following image. Hence, the student should score 98% in “subject 6” to get an overall average of 90%. Click “Ok” to apply the changes.

Example 3-5

Likewise, the Goal Seek helps identify the exact input that should be adjusted to reach the desired result.

The Rules Governing the Parameters

  • The “set cell” should always contain a formula.
  • The formula of the “set cell” should depend, whether directly or indirectly, on the “by changing cell.” This is necessary to study the impact on the “set cell.”
  • The “by changing cell” should not contain any special characters.

Frequently Asked Questions

Define the Goal Seek in Excel.

The Goal Seek in excel calculates the input value (variable) based on a given output. Being a what-if-analysis tool, the Goal Seek is used when there is a need to study the impact of a change in one value on the other.

The Goal Seek is used in scenario analysis, cause and effect situations, break-even model, sensitivity analysis, and so on. The parameters used in the Goal Seek excel tool are listed as follows:
• “Set cell”–This is the reference of the formula cell.
• “To value” –This is the desired or targeted value to be achieved.
• “By changing cell” –This is the cell reference of the variable to be changed for attaining the desired value.
The Goal Seek works with one input at a given time.

What is Goal Seek used for in Excel?

The Goal Seek in excel is used in the following situations:

• To calculate the input (unknown) for a given output (known)
• To analyze the impact of a change in the input (variable) on the output (set cell)
• To perform what-if-analysis, i.e., explore the various outcomes if different values are used for the input
• To return the closest value (approximate) in case a solution to the problem is not found

Note: The formula used in the Goal Seek analysis remains the same throughout. The input values entered in the “by changing cell” box are changed to study the effect on the output.

How does the Goal Seek work in Excel?

The Goal Seek does backward calculations. It begins from the output that is known and returns the exact input. This input is a requisite for reaching the given output.

The steps showing the working of Goal Seek are listed as follows:

1. Enter data in Excel on which calculations using Goal Seek are to be performed.
2. Click “Goal Seek” from the “what-if-analysis” drop-down in the Data tab.
3. Enter the parameters in the tool.
a. Type the cell reference for the input and the output.
b. Type the target value to be achieved.
4. Click “Ok” to proceed.
5. In the “Goal Seek status” box, click “Ok” to apply the changes to the worksheet.

Note: The initial values can be restored by pressing the “undo” shortcut (Ctrl+Z).

Recommended Articles

This has been a guide to Goal Seek in Excel. Here we learn how to use Goal Seek function in Excel along with step by step examples and a downloadable template. You may learn more about Excel from the following articles –

  • Evaluate Formula in ExcelThe Evaluate formula in Excel is used to analyze and understand any fundamental Excel formula such as SUM, COUNT, COUNTA, and AVERAGE. For this, you may use the F9 key to break down the formula and evaluate it step by step, or you may use the “Evaluate” tool.read more
  • Create a Data Table in ExcelA data table in excel is a type of what-if analysis tool that allows you to compare variables and see how they impact the result and overall data. It can be found under the data tab in the what-if analysis section.read more
  • One Variable Excel Data TableOne variable data table in excel means changing one variable with multiple options and getting the results for multiple scenarios. The data inputs in one variable data table are either in a single column or across a row.read more
  • Excel Scenario ManagerScenario Manager is a what-if analysis tool that works with many scenarios that are supplied to it. It uses a set of ranges that have an effect on a certain output and can be used to generate different scenarios such as bad and medium depending on the values.read more
  • Excel Shortcut Paste ValuesPasting values is a common procedure that allows us to eliminate any formatting and formulas from the copied cell and paste them into the pasted cell. «Alt + E + S + V» is the shortcut key for pasting values.read more

Понравилась статья? Поделить с друзьями:
  • Goal and seek excel
  • Go4convert com ru pdf to word
  • Go to end of page word
  • Go to a engine and type in the word freeware
  • Go off course word