Forum

Notifications
Clear all

attribuer un numéro unique par référence/facture, par mois, qui redémarre chaque mois

10 Posts
2 Users
0 Reactions
103 Views
 KNA
(@kna)
Posts: 6
Active Member
Topic starter
 

Objectif de la formule

Créer une numérotation automatique (N° Enreg) :

  • Qui redémarre à 1 chaque mois

  • Basée sur N° Facture, ou à défaut, sur Référence

  • Sans utiliser de formule matricielle

Exemple du resultat attendu

Mois N° Facture Référence N° Enreg
Janvier F001   1
Janvier F002   2
Janvier F001   1
Janvier   R001 3
Janvier   R001 3
Février F001   1
Février   R001 2
Février F002   3
Février F002   3
 
Posted : 25/04/2025 9:41 pm
Riny van Eekelen
(@riny)
Posts: 1190
Member Moderator
 

@kna

Can't respond to you in French, sorry. From what understand is that the long formula you have is not giving the correct result. Perhaps the formula I added in the last column of the table does. If not, please show the result you want to achieve in the your file.

 

 
Posted : 26/04/2025 1:17 am
 KNA
(@kna)
Posts: 6
Active Member
Topic starter
 

Merci Rincy c est bien le résultat recherche et je suis même impressionné par la simplicité de votre raison et je vous en remercie cependant pouvez vous apporter une amélioration à la formule suivante : =SI([@[N° Facture]]<>"";SIERREUR(SI(NB.SI.ENS(INDIRECT("$F$2:F"&LIGNE()-1);$F3;INDIRECT("$B$2:b"&LIGNE()-1);[@Mois])=0;NB.SI.ENS(INDIRECT("$B$2:b"&LIGNE()-1);[@Mois])+1;INDEX(Tableau1[[N° Enreg]:[Libellé]];EQUIV($F3;[N° Facture];0);1));"");SI([@Référence]<>"";SIERREUR(SI(NB.SI.ENS( INDIRECT("$G$2:g"&LIGNE()-1);$G3;INDIRECT("$B$2:b"&LIGNE()-1);[@Mois])=0;NB.SI.ENS( INDIRECT("$B$2:b"&LIGNE()-1);[@Mois])+1;INDEX(Tableau1[[N° Enreg]:[Libellé]];EQUIV($G3;[Référence];0);1));"");"")) qui se trouve dans la colonne N° Enreg afin d obtenir le même résultat. Merci d avance  

 
Posted : 26/04/2025 1:34 am
 KNA
(@kna)
Posts: 6
Active Member
Topic starter
 

Desole Monsieur Riny pour l erreur sur votre nom

 
Posted : 26/04/2025 1:45 am
Riny van Eekelen
(@riny)
Posts: 1190
Member Moderator
 

@kna 

No worries!

I understand you want an improvement on your the formula you pasted. Though, it's in French and  I'm not sure it's the same as in your file. But why would you want to change a rather complex formula if mine (quite simple) seems to resolve your problem?

 
Posted : 26/04/2025 5:07 am
 KNA
(@kna)
Posts: 6
Active Member
Topic starter
 

@riny En fait c est du à un melange de frustration quand je me rend compte que j ai passé des jours pour quelque chose de si complexe aussi la resolution de cette enigme me permettra de revoir mon approche et mon analyse des situations parce que je veux atteindre un niveau d efficacite similaire au votre ce n est pas encore le cas.

voici un traduction du code en anglais =IF([@[Invoice No.]]<>"";IFERROR(IF(COUNTIFS.SENS(INDIRECT("$F$2:F"&LINE()-1);$F3;INDIRECT("$B$2:b"&LINE()-1);[@Month])=0;COUNTIFS.SENS(INDIRECT("$B$2:b"&LINE()-1);[@Month])+1;INDEX(Table1[[Record No.]:[Label]];EQUIV($F3;[Invoice No.];0);1));"");IF([@Reference]<>"";IFERROR(IF(COUNTIFS.SENS( INDIRECT("$G$2:g"&ROW()-1);$G3;INDIRECT("$B$2:b"&ROW()-1);[@Month])=0;COUNTIFS( INDIRECT("$B$2:b"&ROW()-1);[@Month])+1;INDEX(Table1[[Reg No.]:[Label]];EQUIV($G3;[Reference];0);1));"");""))

 

 
Posted : 26/04/2025 7:21 am
Riny van Eekelen
(@riny)
Posts: 1190
Member Moderator
 

@kna 

OK, then that is indeed the formula you had in your file. According to my "translator" your last message reads as follows:

"In fact it is due to a mixture of frustration when I realise that I spent days for something so complex also the resolution of this enigma will allow me to review my approach and my analysis of the situations because I want to reach a level of efficiency similar to yours this is not yet the case."

I don't understand the bolded part. Your current formula is very complicated and I understand that it doesn't return the correct results, but please correct me if I'm wrong.

 
Posted : 26/04/2025 3:44 pm
 KNA
(@kna)
Posts: 6
Active Member
Topic starter
 

@riny En fait je veux dire mon souhaite est d être aussi bon et efficace que vous pour l heure je n ai pas encore atteint ce niveau;

Merci pour votre excellente réponse.

 
Posted : 26/04/2025 5:14 pm
 KNA
(@kna)
Posts: 6
Active Member
Topic starter
 

aussi je souhaite crée un numéro de pièce compose du code journal BDA du mois 02 et du numéro que vous avez créé 001 002 ...  010. QUAND J ESSAIE AVEC LA FONCTION CONCATENER LES NUMERO ENREGISTREMENT NE FONCTIONNE PLUS CORRECTEMENT

 
Posted : 26/04/2025 5:33 pm
Riny van Eekelen
(@riny)
Posts: 1190
Member Moderator
 

@knAPS

 

Perhaps like in column T in the attached file??

 

 
Posted : 26/04/2025 11:19 pm
Share: