aide sur une fonction excel

Copper Contributor

bonjour, je vous explique ma problématique :

dans un premier tableau Excel, j'ai une liste de prix suivi d'une dénomination ex: 98£FV, 100£FA... les lettres sont incluses par un format personnalisé de l'onglet "nombre"(ex : # ##0,00 €" FV")

dans un deuxième tableau, je cherche à extraire la plus grande valeur de ma liste, mais en incluant également les lettres qui suivent mes nombres. 

sur l'exemple donné, ma valeur la plus grande à afficher serait : 100£FA or toutes les formules que je trouve m'affiche la valeur numérique mais pas les lettres associées.

est-ce que quelqu'un pourrait me dire comment faire pour trouver la plus grande valeur d'une liste et en conservant les lettres associées? 

PS: si certaines choses ne paraissent pas claires dans mes explications n'hésitez pas à me demander plus de précisions !

merci par avance pour vos réponses

2 Replies

@ag231590 

 

English:

{=MAX(IF(ISNUMBER(SEARCH("yourLetters1",A1:A999,1)),MID(A1:A999,SEARCH("-",A1:A999,1)+1,99)*1,""))}

Do not enter the {}, but exit the formula with CTRL + SHIFT + ENTER

 

French:

=MAX(SI(ESTNUM(CHERCHE("voslettres1";A1:A999;1));STXT(A1:A999;CHERCHE("-";A1:A999;1)+1;99)*1;""))

N'entrez pas le {}, mais quittez la formule avec CTRL + SHIFT + ENTRÉE

 

or with VBA Code - ou avec code VBA :

 

'French VBA Code

Sub test()
Dim c As Range
Dim xgroß As Long
Dim ygroß As Long

For Each c In Range("A1:A" & Cells(Rows.Count, 1).End(xlUp).Row)
    If Left(c.Value, 3) = "XXX" Then
        If Right(c, Len(c) - 3) > xgroß Then xgroß = Right(c, Len(c) - 3)
    Else
        If Right(c, Len(c) - 3) > ygroß Then ygroß = Right(c, Len(c) - 3)
    End If
Next

MsgBox "Plus grande valeur XXX : " & xgroß
MsgBox "Plus grande valeur YYY : " & ygroß

End Sub

 

 

If everything has not been tested, please try it out and adjust it where necessary.

 

Hope I was able to help you.

 

Nikolino

I know I don't know anything (Socrates)

 

* Kindly Mark and Vote this reply if it helps please, as it will be beneficial to more Community members reading here

@ag231590 The letters you "add" are just changing the way the numbers are displayed. One time 100 becomes 100.00 FV and another time 100.00 FA. But for Excel it still 100.

 

On what basis do you determine the FV or FA part of your format? In other words, why FV in one cell and why FA in another? Perhaps you can apply the same logic to the greatest number found.