最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Excel formula for searching a row for a specific value, and returning the value from another cell in the same column - Stack Ove

programmeradmin1浏览0评论

I have an Excel matrix/chart with dates across the top row, and certain cells with a specific value underneath the relevant dates. I'd like to generate a separate column which shows the dates for which that specific value occurs.

To illustrate this:

01-Apr   02-Apr   03-Apr        Date where 'x' occurs
           x                    02-Apr
  x                             01-Apr
                    x           03-Apr

...So I'm looking for a formula to generate the far right column, that will look for 'x' across each respective row and return the corresponding value from the top row (the date).

I have tried a combination of IF, HLOOKUP and MATCH functions but I cannot get the result I'm looking for. Any help would be much appreciated!

I use Excel 2016.

I have an Excel matrix/chart with dates across the top row, and certain cells with a specific value underneath the relevant dates. I'd like to generate a separate column which shows the dates for which that specific value occurs.

To illustrate this:

01-Apr   02-Apr   03-Apr        Date where 'x' occurs
           x                    02-Apr
  x                             01-Apr
                    x           03-Apr

...So I'm looking for a formula to generate the far right column, that will look for 'x' across each respective row and return the corresponding value from the top row (the date).

I have tried a combination of IF, HLOOKUP and MATCH functions but I cannot get the result I'm looking for. Any help would be much appreciated!

I use Excel 2016.

Share Improve this question asked 2 days ago user29898123user29898123 151 bronze badge
Add a comment  | 

1 Answer 1

Reset to default 2

So you can actually use an index & match to accomplish what you're trying to do. Hlookup, similar to vlookup can't look 'backwards' (or upwards).

First, the index should be the header row you want to check, lock this so it doesn't carry down as you drag the formula. Then for the "row" input, just put 1, since we're only searching that array. Then lastly, we use the match to search each row for the x and return the column number.

=INDEX($A$1:$C$1,1, MATCH("x",A2:C2,0))

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论