Issue with "Like" statements...

BillTony

Board Regular
Joined
May 3, 2017
Messages
70
I have a (long) formula that is functioning quite well.

However, I now need to be able to pick up any variations of "na" that I could potentially run across (NA, N/A, etc.).

In other words, I would like to basically pick up a wildcard value such as "n*".

I understand that "Like" is probably the way to go, but am having some difficulties with any forms that I have come up with so far...

Thanks in advance!

Code:
'Formula in column C - evaluating column B.
'However, there may be variations of "na."
    ActiveCell.FormulaR1C1 = _
        "=IF(RC[-1]=""na"","""",IF(RC[-1]="""","""",IF(AND(IF(ISNUMBER(FIND(""."",RC[-1])),LEN(RC[-1])-FIND(""."",RC[-1]),0)>=2,IF(ISNUMBER(FIND(""."",RC[-1])),LEN(RC[-1])-FIND(""."",RC[-1]),0)<=4),"""",""ERROR"")))"
'CONDITIONAL AutoFill based on last row in column A - 2 header rows.
    If Last_Row_ColA > 3 Then
        Selection.AutoFill Destination:=Range("C3:C" & Last_Row_ColA)
    End If
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
You could "normalize" the value and by that I mean, to check if it is a variation of NA, then you should first lowercase the result and replace all non-alpha characters with empty characters "" and then just check if the value is "na"
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,912
Members
452,366
Latest member
TePunaBloke

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top