在Microsoft Excel 2007中查找并排序相同月份的单个名称(Find and sort same months name as single in Microsoft Excel 200

编程入门 行业动态 更新时间:2024-10-28 18:29:40
在Microsoft Excel 2007中查找并排序相同月份的单个名称(Find and sort same months name as single in Microsoft Excel 2007)

我正在使用Microsoft excel 2010.我有不同的日期,如列E1:E19,不在特定的时间间隔内。 我希望帮助只找到开始月份日期并将它们粘贴到G列中,如图所示。

I am working with Microsoft excel 2010. I have different dates like column E1:E19 that are not in specific interval. I want help to find only starts month date and paste them into G column like shown into the figure.

最满意答案

首先,就是说 - K_B和Ibrahim Odeh都有有效和良好的尝试。 我只想添加另一个选项,因为这些选项使用额外的行或手动工具。

以下是我提出的解决方案的公式,如截图所示 - 只有一列,只有具有开始日期的行:

G1=SUBTOTAL(5,E$1:E$19) G2=SUBTOTAL(5,OFFSET(E$1:E$19,MATCH(EOMONTH(G1,0),E$1:E$19,1),0,ROWS(E$1:E$19)-MATCH(EOMONTH(G1,0),E$1:E$19,1)))

可以将它用于整个列,如下所示:

G1=SUBTOTAL(5,E:E) G2=SUBTOTAL(5,OFFSET(E:E,MATCH(EOMONTH(G1,0),E:E,1),0,ROWS(E:E)-MATCH(EOMONTH(G1,0),E:E,1)))

现在,一些解释:

首先,你需要一个G1的起点 - 所以我们使用SUBTOTAL来获取E列中最早的日期,使用MIN (即5)。

现在我们在这里工作,通过抵消我们用来计算我们的SUBTOTAL ,仍然使用MIN (5)来获得每个月的开始。

诀窍是OFFSET 。 第一个参数是基本范围,我们将偏移,然后我们必须确定要偏移多少行,并且不得错误,我们使用ROWS(basicRange) - rowOffset始终保持在out范围内。

MATCH用于确定必要的偏移量,方法是使用EOMONTH从G1查找当月最后列出的日期行。

希望这能解决任何问题。

编辑:

因为我必须翻译这个,这是原始的:

=TEILERGEBNIS(5;E:E) =TEILERGEBNIS(5;BEREICH.VERSCHIEBEN(E:E;VERGLEICH(MONATSENDE(G1;0);E:E;1);0;ZEILEN(E:E)-VERGLEICH(MONATSENDE(G1;0);E:E;1)))

First of, is to say - both K_B and Ibrahim Odeh have valid and good attemps. I just want to add another option, because those options use additional rows or manual tools.

Here is the formula I came up with to solve this as shown in your screenshot - just one column, just the rows with the starting dates:

G1=SUBTOTAL(5,E$1:E$19) G2=SUBTOTAL(5,OFFSET(E$1:E$19,MATCH(EOMONTH(G1,0),E$1:E$19,1),0,ROWS(E$1:E$19)-MATCH(EOMONTH(G1,0),E$1:E$19,1)))

It is possible to use this for the whole column, like this:

G1=SUBTOTAL(5,E:E) G2=SUBTOTAL(5,OFFSET(E:E,MATCH(EOMONTH(G1,0),E:E,1),0,ROWS(E:E)-MATCH(EOMONTH(G1,0),E:E,1)))

And now, some explaining:

First, you need a starting point in G1 - so we use SUBTOTAL to get the earliest date in column E, using MIN (which is 5).

Now we work from here, by offsetting the range which we use to calculate our SUBTOTAL, still using MIN (5), to get the beginning of each month.

The trick is OFFSET. The first parameter is out basic range, which we will offset, then we have to determine how many rows to offset, and to not get an error, we use ROWS(basicRange) - rowOffset to always stay in out range.

MATCH is used to determine the necessary offset, by looking for the row of the last listed date of the month from G1 using EOMONTH.

Hope this clears any question.

Edit:

Because I do have to translate this, here is the original:

=TEILERGEBNIS(5;E:E) =TEILERGEBNIS(5;BEREICH.VERSCHIEBEN(E:E;VERGLEICH(MONATSENDE(G1;0);E:E;1);0;ZEILEN(E:E)-VERGLEICH(MONATSENDE(G1;0);E:E;1)))

更多推荐

本文发布于:2023-07-15 05:18:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1110588.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:名称   Excel   Microsoft   single   months

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!