编号/排序集相同的列值 [英] Numbering/sequencing sets of same column values

查看:141
本文介绍了编号/排序集相同的列值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何对同一列值的集合进行编号/排序?例如:

How to do numbering/sequencing for sets of same column values? For example:

Col1 Col2
Andy  1
Chad  1
Bill  1 
Andy  2
Bill  2
Bill  3
Chad  2
Bill  4

由于 Andy 有2个值,我想在第2列中对它进行编号1和2。对于 Bill ,我想对它编号1,2,3和4等等。

Since Andy got 2 values, I want to number it 1 and 2 in Column 2. For Bill, I want to number it 1, 2, 3 and 4 and so on.

推荐答案

code> countif 和滑动范围:

You can accomplish this with countif and a sliding range :

   A        B
1  val1     =COUNTIF($A$1:A1, A1)
2  valx     =COUNTIF($A$1:A2, A2)

等等。

列B中的公式可以在列中拖放/自动填充。它固定在范围的开始,只看起来像我们编号的价值一样远; COUNTIF以这种方式计算上一集中的匹配值。

The formula in column B can be dragged down / autofilled in the column. It anchors to the start of the range and only looks as far down as the value we are numbering; COUNTIF is tallying up the matching values in the preceding set this way.

这篇关于编号/排序集相同的列值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆