Hello folks,
how can we use an "If" statement to test if there exists an "X" character in any of the cells within a range?
Thanks
Hello folks,
how can we use an "If" statement to test if there exists an "X" character in any of the cells within a range?
Thanks
is the "X" going to be the only character in the cell or is it just one letter among many like in A2 is X vs in A2 is 60X11A?
Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
Sam Capricci
Use the COUNTIF function:
=COUNTIF(range,"X")>0
Ali
Enthusiastic self-taught user of MS Excel who's always learning!
Don't forget to say "thank you" in your thread to anyone who has offered you help.
You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.
Forum Rules (updated August 2023): please read them here.
Maybe this:
=IF(COUNTIF(A1:D9,"x")>0,"Present","Absent")
Adjust the ranges to suit...
Glenn
None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU
you can use
=SUMPRODUCT(ISNUMBER(SEARCH("X",A4:A20))+0)>0
which will return TRUE or FALSE
then if true - use the IF
=IF(SUMPRODUCT(ISNUMBER(SEARCH("X",A4:A20))+0)>0, "Range Contains an X" , "No X")
Wayne
if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here
If you have a solution to your thread - Please mark your thread solved do the following: >
Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.
Hello folks,
Thanks for replying
I did it like this, is this ok?
Thanks for your helpSub AutoFilterColA() Dim rngFoundCell As Range Set rngFoundCell = Sheets("Sheet1").Range("A6:A10").Find(What:="X") If rngFoundCell Is Nothing Then Range("A6") = "X" End If ... End Sub
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks