SOLVED

Get Liquidation Period

%3CLINGO-SUB%20id%3D%22lingo-sub-1479073%22%20slang%3D%22en-US%22%3EGet%20Liquidation%20Period%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1479073%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%20everyone!%3C%2FP%3E%3CP%3EI%20would%20like%20to%20obtain%20the%20liquidation%20period%20of%20a%20date%20given%20a%20date%20range.%20If%20the%20date%20given%20falls%20between%202%20dates%2C%20I%20need%20excel%20to%20give%20back%20the%20month.%20I%20can%C2%B4t%20make%20it%20work!%20I%20get%20the%20error%20%22wrong%20data%20type%22.%3C%2FP%3E%3CP%3EBy%20the%20way%2C%20is%20there%20any%20chance%20to%20do%20this%20only%20considering%20the%20day%20and%20month%3F%20Thank%20you%3C%2FP%3E%3CP%3EThe%20formula%20I%20use%20is%20this%20%3A%26nbsp%3B%3DBUSCAR(H11%3BY(H11%26lt%3B%3DTabla4%5BDesde%5D%3BH11%26gt%3B%3DTabla4%5BHasta%5D)%3BTabla4%5BPer%C3%ADodo%20de%20liquidaci%C3%B3n%5D)%3C%2FP%3E%3CP%3Ewhich%20is%20equal%20to%3A%26nbsp%3B%20VLOOKUP(H11%3BAND(H11%26lt%3B%3DTabla4%5BDesde%5D%3BH11%26gt%3B%3DTabla4%5BHasta%5D)%3BTabla4%5BPer%C3%ADodo%20de%20liquidaci%C3%B3n%5D)%3C%2FP%3E%3CP%3EThis%20is%20the%20example%3A%3C%2FP%3E%3CDIV%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22error%20excel.JPG%22%20style%3D%22width%3A%20837px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F199911iF5B15183D2715608%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22error%20excel.JPG%22%20alt%3D%22error%20excel.JPG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1479073%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-1479170%22%20slang%3D%22en-US%22%3ERe%3A%20Get%20Liquidation%20Period%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1479170%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F543463%22%20target%3D%22_blank%22%3E%40denisemartincaldareri%3C%2FA%3E%26nbsp%3BNot%20sure%20I%20understand%20your%20date%20ranges.%20The%20first%20one%20says%20from%2016-12-2020%20to%2015-01-2020.%20How%20would%20that%20work%3F%20The%20next%20is%20from%2016-01-2020%20to%2015-02-2020.%20Thereafter%2C%20the%20start%20date%20goes%20back%2011%20months%20in%20time%20and%20the%20end%20date%20goes%20forward%20one%20month.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPerhaps%20you%20just%20want%20to%20determine%20the%20termination%20month%20based%20on%20the%20termination%20date.%20If%20before%20the%2015th%20then%20same%20month.%20If%20equal%20to%20or%20after%20the%2015th%20then%20next%20month.%20If%20so%2C%20the%20formula%20could%20be%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-excel%22%3E%3CCODE%3E%3DIF(DAY(H11)%26lt%3B15%2CTEXT(EDATE(H11%2C0)%2C%22Mmmm%22)%2CTEXT(EDATE(H11%2C1)%2C%22Mmmm%22))%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-excel%22%3E%3CCODE%3E%3DSI(DIA(H11)%26lt%3B15%3BTEXTO(FECHA.MES(H11%3B0)%3B%22Mmmm%22)%3BTEXTO(FECHA.MES(H11%3B1)%3B%22Mmmm%22))%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1481561%22%20slang%3D%22en-US%22%3ERe%3A%20Get%20Liquidation%20Period%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1481561%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F403176%22%20target%3D%22_blank%22%3E%40Riny_van_Eekelen%3C%2FA%3E%26nbsp%3B!%20Thanks%20for%20your%20quick%20reply!%20Yes%2C%20I%20made%20a%20mistake%20in%20the%20example%20I%20sent%2C%20the%20Liquidation%20Period%20starts%20the%2016th%20of%20the%20previous%20month%20and%20ends%20the%2015th%20of%20the%20current%20month.%20Your%20formula%20works%20perfectly%20fine%2C%20I%20just%20added%20a%20%22%3D%22%20symbol%20to%20the%26nbsp%3B%20formula%20so%20as%20to%20consider%20the%20day%20number%2015th%20on%20the%20previous%20month.%3C%2FP%3E%3CP%3ENow%20it%20looks%20like%20this!%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3E%3DSI(DIA(H41)%26lt%3B%3D15%3BTEXTO(FECHA.MES(H41%3B0)%3B%22Mmmm%22)%3BTEXTO(FECHA.MES(H41%3B1)%3B%22Mmmm%22))%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22denisemartincaldareri_0-1592847526866.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F200117i0EB11A17A79C1B96%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22denisemartincaldareri_0-1592847526866.png%22%20alt%3D%22denisemartincaldareri_0-1592847526866.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EThank%20you!!!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1481846%22%20slang%3D%22en-US%22%3ERe%3A%20Get%20Liquidation%20Period%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1481846%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F543463%22%20target%3D%22_blank%22%3E%40denisemartincaldareri%3C%2FA%3E%26nbsp%3BGreat!%20You're%20welcome.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Occasional Contributor

Hi, everyone!

I would like to obtain the liquidation period of a date given a date range. If the date given falls between 2 dates, I need excel to give back the month. I can´t make it work! I get the error "wrong data type".

By the way, is there any chance to do this only considering the day and month? Thank you

The formula I use is this : =BUSCAR(H11;Y(H11<=Tabla4[Desde];H11>=Tabla4[Hasta]);Tabla4[Período de liquidación])

which is equal to:  VLOOKUP(H11;AND(H11<=Tabla4[Desde];H11>=Tabla4[Hasta]);Tabla4[Período de liquidación])

This is the example:

 
 

error excel.JPG

 

 

3 Replies
Highlighted
Best Response confirmed by denisemartincaldareri (Occasional Contributor)
Solution

@denisemartincaldareri Not sure I understand your date ranges. The first one says from 16-12-2020 to 15-01-2020. How would that work? The next is from 16-01-2020 to 15-02-2020. Thereafter, the start date goes back 11 months in time and the end date goes forward one month.

 

Perhaps you just want to determine the termination month based on the termination date. If before the 15th then same month. If equal to or after the 15th then next month. If so, the formula could be:

 

=IF(DAY(H11)<15,TEXT(EDATE(H11,0),"Mmmm"),TEXT(EDATE(H11,1),"Mmmm"))

 

 

 

=SI(DIA(H11)<15;TEXTO(FECHA.MES(H11;0);"Mmmm");TEXTO(FECHA.MES(H11;1);"Mmmm"))

 

 

Highlighted

Hi, @Riny_van_Eekelen ! Thanks for your quick reply! Yes, I made a mistake in the example I sent, the Liquidation Period starts the 16th of the previous month and ends the 15th of the current month. Your formula works perfectly fine, I just added a "=" symbol to the  formula so as to consider the day number 15th on the previous month.

Now it looks like this!

=SI(DIA(H41)<=15;TEXTO(FECHA.MES(H41;0);"Mmmm");TEXTO(FECHA.MES(H41;1);"Mmmm"))

denisemartincaldareri_0-1592847526866.png

Thank you!!!

 

Highlighted

@denisemartincaldareri Great! You're welcome.