如何使用每行的列范围中的最大值标题填充列

时间:2016-01-28 12:08:09

标签: excel

我有一个像这样的CSV文件

Screen Name,Sports,Music,Movies,Politics,Vehicles,Media,Word Count
henrywinter,0.12,0.005714286,0,0.005714286,0,0.017142857,175
BumbleCricket,0.081818182,0.009090909,0,0,0,0.009090909,110
SamWallaceTel,0.196172249,0.009569378,0,0.004784689,0,0.019138756,209
Marcotti,0.06779661,0,0,0,0,0.02259887,177

现在,我如何用每行的一系列列中的最大值标题填充每一行的列?

1 个答案:

答案 0 :(得分:0)

我假设你不想包含字数,因为它总是比其他字数大得多。

如果您将CSV读入A1:H5,然后将此公式放入(比如说)J2并向下拉,则应找到与每行中的最大值匹配的列标题: -

=INDEX($B$1:$G$1,MATCH(MAX($B2:$G2),$B2:$G2,0))

你的例子中的结果总是运动。

enter image description here

(已将B2更改为零以显示已选择媒体)。