Home – Le CFO masqué › Forums › Excel › conditions en excel.
- This topic has 4 replies, 3 voices, and was last updated 7 years ago by
Jean-Marc Voyer.
-
AuthorPosts
-
5 April 2018 at 14 h 33 min #42379
lood
Participantbonsoir,
je suis nouvelle sur excel, j’essaie de faire un si imbriquée avec and et or je n’arrive pas
ma colonne A a plusieurs elements j’ai une colonne pour la date
je crée la colonne Date Dispo
quand c’est SGN1 et SGN2 alors la date dispo est = a la colonne date+2
quand c’est CDD et CDG = dispo
les autres c Faux
mais g un autre problème je n’arrive pas à faire quand c’est un jour de vendredi
alors c’est = date+5
j’utilise plusieurs IF mais j’aime pas mais je ne sais pas utilisé if avec and et or
un petit aide me serait grand utilej’ai mis mon petit fichier pour plus de compréhension
Bien à vous.
Lood.Attachments:
You must be logged in to view attached files.7 April 2018 at 21 h 09 min #42450Jean-Marc Voyer
ParticipantBonjour,
voici une proposition à tester:
=IF(OR([@Type]="SGN1", [@Type]= "SGN2"),IF(WEEKDAY([@Date],2) = 5, [@Date]+5,[@Date]+2), IF(OR([@Type]="CDD", [@Type]="CDG"),"Disponible"))
10 April 2018 at 11 h 29 min #42540lood
ParticipantBonjour
Merci ça m’a vraiment aidé. Je connais WEEKDAY maintenant et je peux l’utiliser.J’ai une autre question
commen faire pour recopier les donnees de deux colonnes differentes dans une autre j’arrive a faire pour les doublons, mais pas pour les autres.
c’est pas fusionner.
ex:
A 1 3 2 4
B 5 2 1 0
C 0 1 2 3 4 5Bien a vous
10 April 2018 at 15 h 42 min #42545Sophie Marchand
ParticipantBonjour,
J’aimerais vous répondre mais je ne comprends pas du tout votre question. Merci de préciser.
Sophie
10 April 2018 at 21 h 06 min #42550Jean-Marc Voyer
ParticipantBonjour,
Par formule, je ne saurais trop comment le faire facilement mais par VBA, voici 2 exemples. Il suffit de sélectionner la plage et d’exécuter la macro (ALT+F8 et choisir la macro)La 1re : éléments ne sont pas triés.
Sub Doublons() Dim rg As Range, c As Range Dim Dic Set Dic = CreateObject("scripting.dictionary") Set rg = Selection For Each c In rg If c.Value <> "" And Not Dic.exists(c.Value) Then Dic.Add c.Value, "" Next c Set rg = Application.InputBox("Choisir cellule destination", , , , , , , 8) rg.Resize(Dic.Count, 1) = Application.Transpose(Dic.keys) End Sub
La 2e : les éléments sont triés:
Sub DoublonsTri() Dim rg As Range, c As Range Dim AL Set AL = CreateObject("system.collections.arraylist") Set rg = Selection For Each c In rg If c.Value <> "" And Not AL.contains(c.Value) Then AL.Add c.Value Next c Set rg = Application.InputBox("Choisir cellule destination", , , , , , , 8) AL.Sort rg.Resize(AL.Count, 1) = Application.Transpose(AL.toarray) End Sub
-
AuthorPosts
- You must be logged in to reply to this topic.