Which excel function should I use?

Asked

Viewed 1,679 times

3

I have a list of names of the masculine and feminine gender that I need to determine in the front cell what is the gender of the name.

The logic that analyzes the name and says if it is masculine and feminine is already ready, however, I need to create the following logic now, but I do not know which Excel function I can use.

In field H4 (number 4) I need to write the function that will take the text of field G4 (number 1), use this text in field C6 (number 2) where the logic that will determine the sex is, and take the result of field C12 (number 3) to return the result in field H4 (number 4) .

I need to apply this logic to all names listed in column G. How should I proceed?

Imagem Exemplo Planilha

  • The C12 field will be varying?

  • Yes... Whenever I enter a new name in the C6 field and press enter, the C12 field will run the logic to verify the name that is in the C6 field and display in the C12 field whether it is MALE or FEMALE

  • I think my answer will help you... but I was very curious... how is this formula to check the gender! =)

  • 2

    hahaha don’t be curious, follow the link where I got the spreadsheet that already has the structure with logic. http://www.postcogito.org/Kiko/PlanilhaMascFemPtBr.html Thank you so much for your help!

  • Cool @Bueno!! Thanks for sharing!! Abs good luck

1 answer

3


One of the ways to solve this would be the following code (vba) in your spreadsheet (Worksheet_Change):

Private Sub Worksheet_Change(ByVal Target As Range)

Dim celNome As String ' Célula onde deseja verificar o nome
Dim celGenero As String ' Célula que retorna o gênero
Dim colEntrada As Integer ' Coluna onde dará entrada de dados (nomes)

    celNome = "C6"
    celGenero = "C12"
    colEntrada = 7 ' 7=coluna "G"

    ' Verifica se está na coluna de entrada de dados        
    If Target.Column = colEntrada Then
        ' Copia o nome inserido na célula de análise
        Range(celNome).Value = Target.Value
        ' Retorna o gênero após análise
        Target.Offset(0, 1).Value = Range(celGenero).Value
    End If

End Sub

Browser other questions tagged

You are not signed in. Login or sign up in order to post.