二分查找中的百分比查找_如何在Excel中查找值之间的差异百分比

二分查找中的百分比查找

二分查找中的百分比查找

You can use Excel to calculate the percentage of change between two values quickly. In our simple example, we show you what you need to know to be able to calculate things like how much the price of gas changed overnight or the percentage of a stock price’s rise or fall.

您可以使用Excel快速计算两个值之间的变化百分比。 在我们的简单示例中,我们向您展示了计算诸如隔夜汽油价格变化或股票价格的涨跌百分比之类的知识。

变更百分比如何运作 (How Percentage of Change Works)

The percentage of change between an original and a new value is defined as the difference between the original value and the new value, divided by the original value.

原始值和新值之间的变化百分比定义为原始值和新值之间的差除以原始值。

(new_value - original_value)/(original_value)

For example, if the price of a gallon of gasoline was $2.999 yesterday on your drive home and it rose to $3.199 this morning when you filled your tank, you could calculate the percentage of change by plugging those values into the formula.

例如,如果昨天开车回家时每加仑汽油的价格为$ 2.999,而今天早上加满油箱时,该价格升至$ 3.199,则可以通过将这些值代入公式来计算变化百分比。

($3.199 - $2.999)/($2.999) =  0.067 = 6.7%

让我们看一个例子 (Let’s Look at an Example)

For our simple example, we will look at a list of hypothetical prices and determine the percentage of change between an original price and a new price.

对于我们的简单示例,我们将查看假设价格列表,并确定原始价格和新价格之间的变化百分比。

Here is our sample data containing three columns: “Original Price,” “New Price,” and “Percentage of Change.”  We have formatted the first two columns as dollar amounts.

这是我们的示例数据,其中包含三列:“原始价格”,“新价格”和“变化百分比”。 我们将前两列的格式设置为美元金额。

Example Data

Start by selecting the first cell in the “Percentage of Change” column.

首先在“变化百分比”列中选择第一个单元格。

Select Cell G3

Type the following formula and then press Enter:

键入以下公式,然后按Enter:

=(F3-E3)/E3
Enter Formula

The result will appear in the cell.  It is not formatted as a percentage, yet. To do that, first select the cell containing the value.

结果将显示在单元格中。 尚未格式化为百分比。 为此,首先选择包含该值的单元格。

Formula Result

In the “Home” menu, navigate to the “Numbers” menu. We will use two buttons—one to format the cell value as a percentage and another to reduce the number of decimal places so that the cell only shows the tenths place.  First, press the “%” button.  Next, press the “.00->.0” button.  You can use either of the buttons on the right side of the menu to increase or decrease the displayed precision of the value.

在“主页”菜单中,导航到“数字”菜单。 我们将使用两个按钮-一个用于将单元格值格式化为百分比格式,另一个用于减少小数位数,以便该单元格仅显示十分之一位。 首先,按“%”按钮。 接下来,按“ .00->。0”按钮。 您可以使用菜单右侧的任何一个按钮来增加或减少显示的值精度。

Number Menu

The value is now formatted as a percentage with only one decimal place displayed.

现在,该值已格式化为百分比格式,仅显示小数点后一位。

Formatted as Percent with One Decimal Place

Now we can calculate the percentage of change for the remaining values.

现在我们可以计算剩余值的变化百分比。

Select all of the cells of the “Percentage of Change” column and then press Ctrl+D. The Ctrl+D shortcut fills data down or to the right through all selected cells.

选择“更改百分比”列中的所有单元格,然后按Ctrl + D。 Ctrl + D快捷键将所有选定单元格的数据向下或向右填充。

Fill Cells Down

Now we are done, all of the percentages of change between the original prices and the new prices have been calculated. Notice that when the “New Price” value is lower than the “Original Price” value, the result is negative.

现在我们完成了,已经计算出原始价格和新价格之间的所有变化百分比。 请注意,当“新价格”值低于“原始价格”值时,结果为负。

翻译自: https://www.howtogeek.com/405548/how-to-find-the-percentage-of-difference-between-values-in-excel/

二分查找中的百分比查找

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值