通过查找行中的值来获取列 [英] Get column by finding value in the row

查看:85
本文介绍了通过查找行中的值来获取列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Excel中,我已经研究了hlookup,vlookup,match,index,但是这些功能都没有这样做:



我需要找到一个文本值A1:Z1并得到它的列。例如,我发现F1中的值,然后我想要一个结果F:F。



编辑:这是我想要添加到的功能: p>

= COUNTIFS(Source!B:B; Result!C3; Source!AT:AT; Result!$ D $ 2)



我需要源代码!B:B和源代码AT:AT是一个搜索功能,可以在不同表单(Source)的表格行和列中查找一个特定的值。

解决方案

INDEX函数可以返回一个整列,例如假设您要在A1中搜索x:尝试



= INDEX(A:Z; 0; MATCH(x; A1:Z1; 0))



注意:这不返回文本字符串,如F:F,它返回对您通常在期望整个列引用的函数中使用的列,例如SUM,SUMIF,LOOKUP等。



已编辑:您可以在COUNTIFS函数中使用以上内容:



<!code> = COUNTIFS(INDEX(源A:Z者除外; 0; MATCH( X;来源!A1:Z1; 0));结果C3;来源AT:!!! AT;结果$ D $ 2 )根据第一个找到的位置x,使第一个范围动态(列A和Z之间根据需要扩展)

来源!A1:Z1,例如如果在J1中首次找到x,则COUNTIFS使用Source!J:J作为第一个范围 - 您可以对COUNTIFS中的任何范围执行此操作


In Excel, I've looked into hlookup, vlookup, match, index, but none of these functions do following:

I need to find a text value in A1:Z1 and get the column of it. For example, I found the value in F1 , then I want a result F:F.

EDIT: This is the function I want it to be added to :

=COUNTIFS(Source!B:B;Result!C3;Source!AT:AT;Result!$D$2)

I need the Source!B:B and alternatively Source!AT:AT be a search function that looks for a specific value in my table row and column in different sheet (Source).

解决方案

INDEX function can return a whole column, e.g. assuming you want to search for "x" in A1:Z1 try

=INDEX(A:Z;0;MATCH("x";A1:Z1;0))

Note: this doesn't return a text string like F:F, it returns a reference to the column in question which you would normally use within a function that expects a whole column reference, e.g. SUM, SUMIF, LOOKUP etc.

Edited: You can use the above in COUNTIFS function like this:

=COUNTIFS(INDEX(Source!A:Z;0;MATCH("x";Source!A1:Z1;0));Result!C3;Source!AT:AT;Result!$D$2)

That makes the first range dynamic (between columns A and Z - extend as required) based on where "x" is first found in Source!A1:Z1, e.g. if "x" is first found in J1 then COUNTIFS uses Source!J:J for the first range - you can do that for any of the ranges in COUNTIFS

这篇关于通过查找行中的值来获取列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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