• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

2 conditions mark true

makfromtz

New Member
Please look into the below question

Expected results after formula on c1

BEADSMEN BEDESMEN FALSE
BEADWORK BODYWORK TRUE
BEAGLERS BOGGLERS TRUE
BEAGLING BAGELING FALSE
STOREYED SURVEYED TRUE

Formula LOGIC

If either a1 or a2 has 3 consonants in the first 4 letters of the word , then mark TRUE otherwise FALSE
 

Attachments

  • MULTIPLE condition.xlsx
    8 KB · Views: 6

makfromtz

A vowel is a syllabic speech sound pronounced without any stricture in the vocal tract.
Each country can has different number of vowels ... as well as consonants.
This UDF-sample uses one set of vowels.
 

Attachments

  • makfromtz.xlsb
    15.9 KB · Views: 7
Attached example with more words in case anyone is able to shoot the required formula

Thank you and Please
 

Attachments

  • MULTIPLE condition add examples.xlsx
    8.9 KB · Views: 3
May be!

Code:
=IF(OR(ConsonantCount(LEFT(A1, 4))>=3, ConsonantCount(LEFT(A2, 4))>=3), TRUE, FALSE)


UDF

Code:
Function ConsonantCount(str As String) As Integer
    Dim i As Integer
    Dim consonantCount As Integer
    Dim vowels As String
    Dim letter As String
    
    ' Define vowels
    vowels = "aeiou"
    
    ' Initialize consonant count
    consonantCount = 0
    
    ' Loop through each letter in the string
    For i = 1 To Len(str)
        ' Get the current letter
        letter = Mid(str, i, 1)
        
        ' Check if the letter is a consonant (not a vowel)
        If InStr(1, vowels, letter, vbTextCompare) = 0 And letter Like "[a-zA-Z]" Then
            consonantCount = consonantCount + 1
        End If
    Next i
    
    ' Return the consonant count
    ConsonantCount = consonantCount
End Function
 
Back
Top