简体   繁体   English

Excel公式将如何检查单元格的范围(如果范围内有值)并输出行的值

[英]How would a excel formula be to check the range of cells if there is a value within a range and output the value of the row

output that value in this row 在该行中输出该值

example: 例:

    A    B    C    D    E
1  one  N/A  N/A  N/A  N/A
2  N/A  two  N/A  N/A  N/A
3  N/A  N/A  N/A   3   N/A
4  N/A  N/A  N/A  N/A   4

Now lets say that in the F column I want to have all the values that only have a value different than N/A 现在让我们说,在F列中,我想要所有值都与N / A不同的值

    A    B    C    D    E    F
1  one  N/A  N/A  N/A  N/A  one 
2  N/A  two  N/A  N/A  N/A  two
3  N/A  N/A  N/A   3   N/A   3
4  N/A  N/A  N/A  N/A   4    4

what I was thinking of doing was something like this don't know how to use the vlookup for this... don't know if this is the right course of action 我当时想做的是类似这样的事情,不知道如何使用vlookup ...不知道这是否是正确的做法

=IF(ISNA(VLOOKUP(A1,Sheet1!$A:$A,1,false)),"N/A",""& value_here &"")

Try this in F1 and copy down 在F1中尝试并复制下来

=LOOKUP(2,1/(A1:E1<>"N/A"),A1:E1)

在此处输入图片说明

Edit: Use the Evaluate Formula tool to step through the formula and see how it works. 编辑:使用“评估公式”工具逐步浏览公式,并查看其工作原理。 First, the (A1:E1<>"N/A") is resolved into an array of False and one True values. 首先,将(A1:E1<>"N/A")解析为False和一个True值的数组。 Then that array is used as the divisor, which results in an array with many #Div/0! 然后将该数组用作除数,从而导致数组中包含许多#Div / 0! values for each False and numbers for each True. 每个False的值和每个True的数字。

Lookup is then performed, searching for a 2, which will find the position of the last number in the array, since all values are smaller than 1. The respective value of that array position is then returned. 然后执行查找,搜索2,这将找到数组中最后一个数字的位置,因为所有值均小于1。然后返回该数组位置的相应值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM