excel一列平均分成多列_基于多个条件的Excel平均

excel一列平均分成多列

In Excel, you can use the SUMIF and COUNTIF functions, to sum and count values, based on criteria. Did you know that you can also calculate an Excel average, based on multiple criteria?

在Excel中,可以使用SUMIF和COUNTIF函数根据条件对值进行求和计数 。 您是否知道您还可以基于多个条件来计算Excel平均值

平均一个标准 (Average with One Criterion)

If you only have one criterion, you can use the AVERAGEIF function. In the screen shot below, the average quantity is calculated for any orders where Pens were sold.

如果只有一个条件,则可以使用AVERAGEIF函数。 在下面的屏幕截图中,将计算出售笔的任何订单的平均数量。

=AVERAGEIF(A1:A10,"Pen",B1:B10)

= AVERAGEIF(A1:A10,“ Pen”,B1:B10)

averageif01

多个条件的平均值 (Average for Multiple Criteria)

If you need multiple criteria for the average, and you’re using Excel 2007 or a later version, you can use the AVERAGEIFS function.

如果您需要多个平均值标准,并且使用的是Excel 2007或更高版本,则可以使用AVERAGEIFS函数。

In the next screen shot, the AVERAGEIFS formula checks for Pen in column A, and a quantity greater than or equal to 10, in column B. The criteria values are entered on the worksheet – cells D3 and E3 – where they can be changed easily.

在下一个屏幕快照中,AVERAGEIFS公式在A列中检查Pen,在B列中检查大于或等于10的量。标准值输入到工作表上-单元格D3和E3-可以轻松更改它们。

For the rows that meet those criteria – rows 6 and 10 -- an average quantity is calculated.

对于满足这些条件的行(第6和第10行),将计算平均数量。

=AVERAGEIFS(B2:B10,A2:A10,D3,B2:B10,">="&E3)

= AVERAGEIFS(B2:B10,A2:A10,D3,B2:B10,“> =”&E3)

averageifs01

下载样本文件 (Download the Sample File)

To see these average formulas, and other examples, you can download the sample file from my Contextures website: Excel Average Formulas.

若要查看这些平均公式和其他示例,可以从Contextures网站上下载示例文件: Excel Average Formulas

The sample file is zipped, and is in xlsx format (Excel 2007 and later versions).

该示例文件已压缩,并且为xlsx格式(Excel 2007及更高版本)。

翻译自: https://contexturesblog.com/archives/2013/03/19/excel-average-based-on-multiple-criteria/

excel一列平均分成多列

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
使用宏语言可以通过编写代码来将一个Excel表格分多个工作表,具体步骤如下: 1. 首先,打开Excel并选择要分割的表格所在的工作簿。 2. 切换到"开发工具"选项卡,并点击"Visual Basic"按钮以打开"宏编辑器"。 3. 在"宏编辑器"中,选择"插入"菜单,然后选择"模块"以创建一个新模块。 4. 在新模块中,编写宏代码来分割表格。以下是一个示例代码: ```vba Sub SplitSheet() Dim ws As Worksheet Dim newWS As Worksheet Dim lastRow As Long Dim i As Long, j As Long ' 获取原始表格所在的工作表 Set ws = ThisWorkbook.Worksheets("Sheet1") ' 获取原始表格最后一行的行数 lastRow = ws.Cells(ws.Rows.Count, 1).End(xlUp).Row ' 遍历原始表格的每一行数据 For i = 1 To lastRow ' 获取每行的工作表名 sheetName = ws.Cells(i, 1).Value ' 创建新工作表,并将当前行的数据复制到新工作表中 Set newWS = ThisWorkbook.Worksheets.Add(After:=ws) newWS.Name = sheetName ws.Rows(i).EntireRow.Copy newWS.Rows(1) ' 删除原始工作表中已复制的行 ws.Rows(i).EntireRow.Delete i = i - 1 lastRow = lastRow - 1 Next i End Sub ``` 5. 修改代码中的"Sheet1"为你要分割的表格所在的工作表名称。 6. 在代码中可以根据实际需求进行修改,比如可以调整要复制的列数、修改复制的目标位置等。 7. 运行宏,方法是按下"Alt" + "F8"打开"宏对话框",选择"SplitSheet"并点击"运行"按钮。 8. 运行完后,原始表格会被分割多个工作表,每个工作表的数据根据你的代码逻辑进行分割和复制。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值