+ Reply to Thread
Results 1 to 7 of 7

mark Y if word has 4 consecutive vowels

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    01-04-2014
    Location
    East Africa
    MS-Off Ver
    MS OFFICE 2019 PRO
    Posts
    3,626

    mark Y if word has 4 consecutive vowels

    I have this on a1

    RAOULIA
    SAOUARI
    DIANOIA
    URAEMIA

    I need formula on b to mark Y on SAOUARI

    then i have question 2

    I have this on a1

    RAOULIA
    SAOUARI
    DIANOIA
    URAEMIA

    I need formula on b to mark Y on RAOULIA and DIANOIA since it has 3 vowels in a row

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,528

    Re: mark Y if word has 4 consecutive vowels

    Sub test()
    Dim a
    
    a = [A1].CurrentRegion
    ReDim b(1 To UBound(a, 1), 1 To 2)
    
    For r = 1 To UBound(a, 1)
        nv = 0: n = 0
        For i = 1 To Len(a(r, 1)) - 3
            If Mid(a(r, 1), i, 1) Like "*[AEIOU]*" And Mid(a(r, 1), i + 1, 1) Like "*[AEIOU]*" _
            And Mid(a(r, 1), i + 2, 1) Like "*[AEIOU]*" And Mid(a(r, 1), i + 3, 1) Like "*[AEIOU]*" Then
                b(r, 1) = "Y"
                Exit For
            End If
         Next i
         If b(r, 1) = "Y" Then GoTo nextr
         For i = 1 To Len(a(r, 1)) - 2
            If Mid(a(r, 1), i, 1) Like "*[AEIOU]*" And Mid(a(r, 1), i + 1, 1) Like "*[AEIOU]*" _
            And Mid(a(r, 1), i + 2, 1) Like "*[AEIOU]*" Then
                    b(r, 2) = "Y"
                    Exit For
             End If
        Next i
    nextr:
    Next r
    [B1].Resize(UBound(b, 1), 2) = b
    End Sub
    Attached Files Attached Files
    Last edited by JohnTopley; 02-18-2023 at 04:21 PM.
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  3. #3
    Forum Contributor
    Join Date
    01-04-2014
    Location
    East Africa
    MS-Off Ver
    MS OFFICE 2019 PRO
    Posts
    3,626

    Re: mark Y if word has 4 consecutive vowels

    Thank you JT , we leave the thread open for a formula

  4. #4
    Valued Forum Contributor
    Join Date
    11-27-2011
    Location
    usa
    MS-Off Ver
    Excel 2007, Excel 365
    Posts
    495

    Re: mark Y if word has 4 consecutive vowels

    I came up with a UDF (UserDefinedFunction) to allow you to use a formula on the sheet that uses the UDF to complete the result of the formula. Just copy the UDF to a module in the workbook and then You will be able to use it like a formula.

    The UDF to copy to a module:

    Function FCV(CellAddress As String, ConsecutiveVowelCount As Long) As Boolean           ' FCV stands for Find Consecutive Vowels
        Dim StringPosition          As Long
        Dim CVC                     As Long                                                 ' CVC stands for Consecutive Vowel Count
    '
        For StringPosition = 1 To Len(CellAddress)                                          ' Loop through characters of CellAddress
            If LCase(Mid(CellAddress, StringPosition, 1)) Like "[aeiou]" Then               '   If a vowel is found then ...
                CVC = CVC + 1                                                               '       Increment CVC
    '
                If CVC = ConsecutiveVowelCount Then                                         '       If we have reached desired CVC then ...
                    FCV = True                                                              '           Set FCV = True
                    Exit Function                                                           '           Exit this Function
                End If
            Else                                                                            '       Else ...
                CVC = 0                                                                     '           Reset CVC
            End If
        Next                                                                                ' Loop back
    '
        FCV = False                                                                         ' Set FCV to False
    End Function
    Then when you want to use it like a formula:
    just enter a formula in the worksheet something like:

    =IF(FCV(A1,3), "Y", "")

    A1 is the address to check
    3 is the # of consecutive vowel values to check for
    Y is the result you want to display if # of consecutive vowel values were found
    "" is the result if # of consecutive vowel values were not found

    Example formulas to put in cell on sheet:

    =IF(FCV(A1,3), "Y", "")

    Or

    =IF(FCV(A2,4), "Y", "")

  5. #5
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,672

    Re: mark Y if word has 4 consecutive vowels

    Formula solution. TEXTJOIN function is used. But 2010 version is not having TEXTJOIN function. It may help somebody.
    For 4 consecutive vowels, In B1 copied down.
    Formula: copy to clipboard
    =IF(ISNUMBER(FIND("1111",TEXTJOIN("",TRUE,1*(ISNUMBER(FIND(MID(A1,ROW($1:$7),1),"AEIOU")))))),"Y","")

    For 3 consecutive vowels, In C1 copied down.
    Formula: copy to clipboard
    =IF(ISNUMBER(FIND("111",TEXTJOIN("",TRUE,1*(ISNUMBER(FIND(MID(A1,ROW($1:$7),1),"AEIOU")))))),"Y","")
    Attached Files Attached Files
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  6. #6
    Forum Expert
    Join Date
    04-14-2009
    Location
    Taiwan
    MS-Off Ver
    Excel 2016,2019,O365
    Posts
    2,062

    Re: mark Y if word has 4 consecutive vowels

    Try this,

    B1
    =IF(SUM(--(FREQUENCY(IF(ISNUMBER(FIND(MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1),"AEIOU")),ROW(INDIRECT("1:"&LEN(A1)))),IF(NOT(ISNUMBER(FIND(MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1),"AEIOU"))),ROW(INDIRECT("1:"&LEN(A1)))))=4)),"Y","")

    committed with Ctrl+Shift+Enter, copied down

    C1
    =IF(SUM(--(FREQUENCY(IF(ISNUMBER(FIND(MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1),"AEIOU")),ROW(INDIRECT("1:"&LEN(A1)))),IF(NOT(ISNUMBER(FIND(MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1),"AEIOU"))),ROW(INDIRECT("1:"&LEN(A1)))))=3)),"Y","")

    committed with Ctrl+Shift+Enter, copied down
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    02-20-2023
    Location
    NL
    MS-Off Ver
    2016,2019,365,Web
    Posts
    3

    Re: mark Y if word has 4 consecutive vowels

    You can try:

    =IF(MAX(FREQUENCY(IF(ISNUMBER(SEARCH(MID(A1,ROW(A$1:INDEX(A:A,LEN(A1))),1),"aeiou")),ROW(A$1:INDEX(A:A,LEN(A1)))),IF(ISNUMBER(SEARCH(MID(A1,ROW(A$1:INDEX(A:A,LEN(A1))),1),"aeiou")),0,ROW(A$1:INDEX(A:A,LEN(A1))))))=3,"Y","N")
    Its an CSE-entered formula.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] If last two letters vowels MARK as Y
    By makinmomb in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 02-14-2023, 04:15 AM
  2. [SOLVED] Mark Y if last two letters are VOWELS
    By makinmomb in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-22-2022, 06:05 AM
  3. [SOLVED] How to remove all vowels from a group of words unless it is the first letter of a word?
    By autumnalblues in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 01-24-2022, 04:31 AM
  4. if last word is S , comment MARK
    By makinmomb in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-28-2017, 05:06 AM
  5. [SOLVED] Any three consecutive vowels summary
    By makinmomb in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 02-22-2017, 11:33 AM
  6. [SOLVED] to separate the vowels and the consonants of a word.
    By gencoglu27 in forum Excel General
    Replies: 4
    Last Post: 12-26-2011, 05:02 PM
  7. mark data repeated in consecutive cell in a column
    By seafarer in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-25-2008, 02:57 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1