How can I pull any cells with a value greater than a number?

拈花ヽ惹草 提交于 2021-01-25 09:10:49

问题


I asked a similar question to this here but I realized the >=1400 can be either before or after my "x".

I'm trying to look at the number of users who are on screens larger than 1400. I have my Excel sheet, and tried doing an IF statement, but because of the "x" in the middle, it's not working properly and is instead just pulling all of the cells, even the ones with screen sizes less than 1400. I want to be able to pull all cells with Screen Resolution values larger than 1400 on either the first or second number.

All of the numbers highlighted in yellow would be the ones pulled.

I've tried doing slight variations of the =IF(--LEFT(A2,SEARCH("x",A2&"x")-1)>1400,A2,"No") but I can't find the right format to narrate that I want the formula to look at both numbers on either side of the "x".


回答1:


You can try this:

=IFERROR(IF(OR(VALUE(LEFT(A2,SEARCH("X",A2)-1))>=1400,VALUE(RIGHT(A2,LEN(A2)-SEARCH("X",A2)))>=1400),A2,"No"),"")



回答2:


Another option with array formula:

=IF(OR(FILTERXML("<a><b>"&SUBSTITUTE(A2,"x","</b><b>")&"</b></a>","//b[1 or 2]")>1400),A2,"No")

Array formula after editing is confirmed by pressing ctrl + shift + enter




回答3:


As you are using Excel365 then try below formula.

=FILTER(A2:A10,(--TRIM(LEFT(SUBSTITUTE(A2:A10,"x",REPT(" ",100)),100))>=1400)+(--TRIM(RIGHT(SUBSTITUTE(A2:A10,"x",REPT(" ",100)),100))>=1400))

Or use-

=FILTER(A2:A10,(FILTERXML("<t><s>"&SUBSTITUTE(A2:A10,"x","</s><s>")&"</s></t>","//s[1]")>=1400)+(FILTERXML("<t><s>"&SUBSTITUTE(A2:A10,"x","</s><s>")&"</s></t>","//s[2]")>=1400))




回答4:


As an alternative to using a complicated formula, you could just split the data up.

Create two new columns next to column A. Then use text to columns and delimit on the “x”.

In the E column use a simple formula of

IF(OR(B2>=1400,C2>=1400),”True”,”False”)


来源:https://stackoverflow.com/questions/65622899/how-can-i-pull-any-cells-with-a-value-greater-than-a-number

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!