简体   繁体   English

在 Google 表格的日期列表中计算一个月的实例数

[英]Counting the number of instances of a month in a list of dates in Google Sheets

I have a large spreadsheet containing job information.我有一个包含工作信息的大型电子表格。 I am trying to make a "Job Count by Month" field, and it doesn't pull correctly.我正在尝试创建一个“按月计算的作业”字段,但它没有正确拉动。

My Job Info is all located in a sheet called "3PL Jobs".我的工作信息都位于名为“3PL 工作”的工作表中。 I have a hidden sheet titled "Under The Hood" which contains a table of months next to their names (ie 'Under The Hood':E2,E13 is a column of numbers and the F column has the corresponding "January","February". etc.我有一个名为“Under The Hood”的隐藏表,其中包含他们名字旁边的月份表(即“Under The Hood”:E2,E13 是一列数字,F 列有相应的“January”,“February” “。 ETC。

I've made a cell with a dropdown list of the months (pulling from the Under The Hood sheet) and in the cell directly to the right I want it to output the number of completed jobs.我制作了一个带有月份下拉列表的单元格(从引擎盖下的工作表中拉出),并在右侧的单元格中,我希望它为 output 完成的工作数量。

I got this working with the dropdown month list being just a simple list of numbers and not the name, but it looks awful so I was hoping to use an index match to be able to use the name.我使用下拉月份列表只是一个简单的数字列表而不是名称,但它看起来很糟糕,所以我希望使用索引匹配来使用名称。

This is the code that worked with a list of month numbers, using I19 as the entry cell for the month number这是处理月份编号列表的代码,使用 I19 作为月份编号的输入单元格

=COUNTIFS(ARRAYFORMULA(MONTH('3PL Jobs'!C3:C)),I19,'3PL Jobs'!AR3:AR,"COMPLETE")

This is the code I've tried to include to index/match the month name (this in theory should just output the month number based on the name selected in I18, but it outputs "8" no matter what is selected)这是我尝试包含的用于索引/匹配月份名称的代码(理论上这应该只是 output 基于 I18 中选择的名称的月份编号,但无论选择什么,它都会输出“8”)

=arrayformula(index('Under The Hood':E2,E13,MATCH(I18:'Under The Hood',F2:F13),1))

I'm sure I'm missing something simple, but this is driving me nuts!我确定我错过了一些简单的东西,但这让我发疯了!

to turn month name into month number all you need is:要将月份名称转换为月份编号,您只需要:

=MONTH(I18&1)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在 Google 表格中计算公式中的文本实例? - Counting instances of text in a formula in Google Sheets? Google 表格 - 在 2 个日期之间关闭的员工顺序列表 - Google Sheets - Sequential List of Staff off between 2 dates Google 表格:图表计数组合 - Google Sheets: Chart counting combinations 在 Google 表格中的日期列表之间自动填充日期并链接到其他列 - Auto-populate dates between list of dates in Google Sheets and link with additional column 在 Google 表格中组合日期和值 - Combining dates and values in Google Sheets 谷歌表格公式提取日期 - Google Sheets formula to extract dates 使用附加条件计算 Google 表格中的首次出现 - Counting first occurrence in Google Sheets with additional condition 如何在 Google 表格中重复 LAMBDA 生成的日期序列一定次数 - How to repeat a LAMBDA generated sequence of dates a certain number of times in Google Sheets 检查数字是否在范围内 - Google 表格 - Check if number in range - Google sheets 我正在尝试在 google 表格中编写一个简单的脚本,它从列表中读取一个 ID 号并输出与其关联的名称 - I'm trying to write a simple script in google sheets, that reads an ID number from a list and outputs the name associated to it
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM