[英]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.