0

假设有这样垂直排列的数据:

Name      Birthday
John      6 June
Mary      12 May
Sue       1 June
Brian     10 August
Carl      24 June
Ted       18 August
Linda     31 January

是否可以在 Excel(没有 VB)中将数据排序到列箱中?

Jan    Feb    Mar    Apr    May    Jun    Jul    Aug    Sep    Oct    Nov    Dec
Linda                       Mary   John          Brian
                                   Sue           Ted
                                   Carl

(更好的办法是让它们按出生日期在每个垃圾箱中排序。)

4

2 回答 2

0

FYI, this is a bit complicated, so it might be hard to maintain/explain to someone else what you did.

Result:

enter image description here

  1. In Cells D1 to O1, put in 1/1, 2/1, 3/1, etc
  2. Select those cells, right-click --> Format Cells...
  3. Choose Custom and put "mmm" (without quotes)
  4. In D2, put this formula in there: =IFERROR(INDEX($A$2:$A$8,SMALL(IF(MONTH($B$2:$B$8)=MONTH(D$1),MATCH("~"&$A$2:$A$8,$A$2:$A$8&"",0)),ROWS($2:2))),"")
  5. Enter that formula with CTRL+SHIFT+ENTER (array formula)
  6. At the bottom right of D2, there is a little black square, hover over this and your mouse will turn into a plus sign. Click this and drag down to cell D8.
  7. Cells D2:D8 will be highlighted. Click the little square again found in D8. Drag to the right all the way till Dec

And there you have it.

I'd like to thank Aladin for the help with this formula:

http://www.mrexcel.com/forum/excel-questions/470371-unique-list-based-criteria.html#post2322387

于 2013-02-07T21:25:33.057 回答
0

在不修改数据或使用 VBA 的情况下,我认为您将获得的最接近的是数据透视表:

在此处输入图像描述

  1. 点击您的数据
  2. 插入 --> 数据透视表
  3. 好的
  4. 像这样拖动字段:名称--> 行标签。生日 --> 列标签。名称 --> 值
  5. 右键单击列字段中的日期 --> 组...
  6. 选择月份 --> 确定

多田

于 2013-02-07T19:44:27.740 回答