SOLVED

Table for invoice number

%3CLINGO-SUB%20id%3D%22lingo-sub-2595981%22%20slang%3D%22en-US%22%3ETable%20for%20invoice%20number%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2595981%22%20slang%3D%22en-US%22%3E%3CP%3EHello%2C%20i%20have%20a%20simple%20question%20to%20ask.%20I%20have%20a%20file%20in%20excel%20that%20i%20use%20to%20print%20the%20invoice%20for%20my%20work%20and%20also%20to%20store%20the%20data%20of%20the%20client%20and%20the%20link%20to%20the%20previous%20invoice.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20one%20of%20the%20table%20i%20wanted%20to%20have%20the%20invoice%20progressive%20number%20and%20in%20order%20to%20do%20so%20i%20used%20the%20concatenate%20function%20and%20i%20simply%20put%20the%20progressive%20of%20the%20month%20and%20the%20year.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThis%20was%20okay%20untill%20now%20because%20i%20made%20one%20invoice%20at%20month%2C%20but%20now%20i%20need%20to%20make%20three%20of%20them%20each%20month.%20Is%20there%20a%20more%20elegant%20solution%20that%20automatically%20generate%20the%20progressive%20number%20as%20shown%20without%20having%20to%20add%20the%20number%20manually%3F%20It%20also%20need%20to%20change%20the%20year%20after%20the%20last%20invoice%20of%20the%20current%20year.%3CBR%20%2F%3E%3CBR%20%2F%3EI've%20attached%20a%20screenshot%20of%20the%20table%20right%20now.%20The%20formula%20that%20i'm%20using%20is%20the%20following%20(i%20take%20as%20example%20the%20cell%20B40)%3CBR%20%2F%3E%3CBR%20%2F%3E%3DCONCATENATE(E40%3B%22.%22%3B%24F%2440)%3CBR%20%2F%3E%3CBR%20%2F%3EThank%20you%20in%20advance.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2595981%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2597912%22%20slang%3D%22en-US%22%3ERe%3A%20Table%20for%20invoice%20number%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2597912%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1116306%22%20target%3D%22_blank%22%3E%40AcquaRegia%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EGlad%20that%20you%20found%20a%20solution.%20The%20Italian%20version%20of%20the%20formula%20that%20I%20posted%20would%20be%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3DTESTO(RESTO(QUOZIENTE(RIF.RIGA()-1%3B3)%3B12)%2B1%3B%2200%22)%26amp%3B%22.%22%26amp%3BQUOZIENTE(RIF.RIGA()-1%3B36)%2B18%26amp%3B%22.%22%26amp%3BRESTO(RIF.RIGA()-1%3B3)%2B1%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2597892%22%20slang%3D%22en-US%22%3ERe%3A%20Table%20for%20invoice%20number%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2597892%22%20slang%3D%22en-US%22%3EThanks%2C%20i%20couldn't%20use%20the%20one%20you%20wrote%20(i've%20tried%20to%20translate%20in%20italian%20but%20some%20function%20does%20not%20translate%20exactly)%2C%20but%20with%20this%20i%20was%20able%20to%20make%20a%20new%20one%20that%20works%20perfectly.%20I've%20used%3CBR%20%2F%3E%3CBR%20%2F%3E%3DTEXTJOIN(%22.%22%2CTRUE%2CTEXT(ROW()-3%3B%2200%22)%2CRIGHT(B4%2C2))%3CBR%20%2F%3E%3CBR%20%2F%3ESo%20for%20example%20this%20is%20the%20one%20in%20the%20cell%20A4.%20In%20B4%20i%20wrote%20the%20year%20as%20a%20four%20digit%20number%20and%20all%20i%20have%20to%20do%20is%20change%20the%20year%20whenever%20i%20print%20the%20last%20invoice%20of%20the%20year%20and%20change%20the%20-3%20based%20on%20whatever%20the%20number%20of%20the%20row%20is%20the%20for%20the%20first%20invoice%20of%20the%20new%20year.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2597815%22%20slang%3D%22en-US%22%3ERe%3A%20Table%20for%20invoice%20number%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2597815%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1116306%22%20target%3D%22_blank%22%3E%40AcquaRegia%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFor%20example%20in%20row%201%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3DTEXT(MOD(QUOTIENT(ROW()-1%2C3)%2C12)%2B1%2C%2200%22)%26amp%3B%22.%22%26amp%3BQUOTIENT(ROW()-1%2C36)%2B%3CSTRONG%3E18%3C%2FSTRONG%3E%26amp%3B%22.%22%26amp%3BMOD(ROW()-1%2C3)%2B1%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAnd%20then%20fill%20down%20as%20far%20as%20you%20want.%20This%20version%20will%20start%20with%2001.18.1%20for%202018.%20If%20you%20want%20to%20start%20in%20a%20different%20year%2C%20change%20%3CSTRONG%3E18%3C%2FSTRONG%3E%20in%20the%20formula.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2597802%22%20slang%3D%22en-US%22%3ERe%3A%20Table%20for%20invoice%20number%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2597802%22%20slang%3D%22en-US%22%3EI'm%20sorry%20for%20the%20delay%20in%20the%20response.%20Unfortunately%20i%20do%20not%20have%20acces%20to%20Excel%20365%2C%20my%20copy%20of%20Excel%20comes%20from%20a%20suite%20of%20Office%20Professional%20Plus%202019.%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2596089%22%20slang%3D%22en-US%22%3ERe%3A%20Table%20for%20invoice%20number%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2596089%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1116306%22%20target%3D%22_blank%22%3E%40AcquaRegia%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20can%20see%20why%20you%20are%20confused%2C%20but%20the%20formula%20is%20just%20a%20standard%20worksheet%20formula%20in%20Excel%20365!%3C%2FP%3E%3CP%3ELET%20is%20a%20new%20worksheet%20function%20that%20uses%20an%20alternating%20pattern%20of%20parameters%20to%20define%20names%20(variables)%20and%20the%20formulas%20that%20they%20refer%20to.%26nbsp%3B%20SEQUENCE%20is%20another%20function%20that%20I%20have%20used%20to%20generate%20an%20index%20column%20but%20in%20legacy%20Excel%20this%20would%20be%20done%20with%20ROW().%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20key%20question%20is%20do%20you%20have%20access%20to%20Excel%20365%3F%26nbsp%3B%20It%20is%20very%20different%20from%20anything%20that%20has%20gone%20before.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2596051%22%20slang%3D%22en-US%22%3ERe%3A%20Table%20for%20invoice%20number%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2596051%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F214174%22%20target%3D%22_blank%22%3E%40Peter%20Bartholomew%3C%2FA%3E%26nbsp%3Byeah%2C%20i%20think%20you'll%20need%20to%20guide%20me%20to%20use%20that%20%5E%5E%22%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20quite%20skilled%20in%20the%20basics%20of%20excel%20with%20formulas%20and%20so%20on%2C%20but%20i%20don't%20know%20how%20to%20use%20VBA%20and%20other%20things%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2596046%22%20slang%3D%22en-US%22%3ERe%3A%20Table%20for%20invoice%20number%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2596046%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1116306%22%20target%3D%22_blank%22%3E%40AcquaRegia%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAs%20a%20365%20dynamic%20array%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-excel-formula%22%3E%3CCODE%3E%3D%20LET(%0A%20%20k%2C%20%20%20%20SEQUENCE(108%2C1%2C0)%2C%0A%20%20m%2C%20%20%20%20QUOTIENT(k%2C3)%2C%0A%20%20date%2C%20EDATE(start%2Cm)%2C%0A%20%20seq%2C%20%201%2BMOD(k%2C3)%2C%0A%20%20TEXT(date%2C%22mm.yy-%22)%26amp%3Bseq%20)%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3Eseems%20to%20work.%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

Hello, i have a simple question to ask. I have a file in excel that i use to print the invoice for my work and also to store the data of the client and the link to the previous invoice.

 

In one of the table i wanted to have the invoice progressive number and in order to do so i used the concatenate function and i simply put the progressive of the month and the year. 

 

This was okay untill now because i made one invoice at month, but now i need to make three of them each month. Is there a more elegant solution that automatically generate the progressive number as shown without having to add the number manually? It also need to change the year after the last invoice of the current year.

I've attached a screenshot of the table right now. The formula that i'm using is the following (i take as example the cell B40)

=CONCATENATE(E40;".";$F$40)

Thank you in advance.

7 Replies

@AcquaRegia 

As a 365 dynamic array

= LET(
  k,    SEQUENCE(108,1,0),
  m,    QUOTIENT(k,3),
  date, EDATE(start,m),
  seq,  1+MOD(k,3),
  TEXT(date,"mm.yy-")&seq )

seems to work.

@Peter Bartholomew yeah, i think you'll need to guide me to use that ^^"

 

I'm quite skilled in the basics of excel with formulas and so on, but i don't know how to use VBA and other things

@AcquaRegia 

I can see why you are confused, but the formula is just a standard worksheet formula in Excel 365!

LET is a new worksheet function that uses an alternating pattern of parameters to define names (variables) and the formulas that they refer to.  SEQUENCE is another function that I have used to generate an index column but in legacy Excel this would be done with ROW().

 

The key question is do you have access to Excel 365?  It is very different from anything that has gone before.

I'm sorry for the delay in the response. Unfortunately i do not have acces to Excel 365, my copy of Excel comes from a suite of Office Professional Plus 2019.
best response confirmed by AcquaRegia (New Contributor)
Solution

@AcquaRegia 

For example in row 1:

 

=TEXT(MOD(QUOTIENT(ROW()-1,3),12)+1,"00")&"."&QUOTIENT(ROW()-1,36)+18&"."&MOD(ROW()-1,3)+1

 

And then fill down as far as you want. This version will start with 01.18.1 for 2018. If you want to start in a different year, change 18 in the formula.

Thanks, i couldn't use the one you wrote (i've tried to translate in italian but some function does not translate exactly), but with this i was able to make a new one that works perfectly. I've used

=TEXTJOIN(".",TRUE,TEXT(ROW()-3;"00"),RIGHT(B4,2))

So for example this is the one in the cell A4. In B4 i wrote the year as a four digit number and all i have to do is change the year whenever i print the last invoice of the year and change the -3 based on whatever the number of the row is the for the first invoice of the new year.

@AcquaRegia 

Glad that you found a solution. The Italian version of the formula that I posted would be

 

=TESTO(RESTO(QUOZIENTE(RIF.RIGA()-1;3);12)+1;"00")&"."&QUOZIENTE(RIF.RIGA()-1;36)+18&"."&RESTO(RIF.RIGA()-1;3)+1