简体   繁体   English

通过excel公式在列中列出每年,每月,每季度,每两周的日期间隔

[英]List yearly, monthly, quarterly, biweekly dates interval in a column through excel formula

I have the table below.我有下表。

在此处输入图片说明

In the first column, I placed the periods (or the number of instances; it works like an ID in this table).在第一列中,我放置了句点(或实例数;它的作用类似于此表中的 ID)。 The table is named "LoanSchedule".该表被命名为“LoanSchedule”。 $B$20 stores a date. $B$20 存储一个日期。 In this case, I entered February 20, 2020. I have this formula in Column 2 to list the consecutive monthly date after $B$20.在本例中,我输入了 2020 年 2 月 20 日。我在第 2 列中有这个公式来列出 $B$20 之后的连续每月日期。 $B$18 stores the number of times payment is made in a year $B$18 存储一年内付款的次数

=IF(AND([@[Payment Period]]<>"",$B$20<>"--"),IF($B$18=12,EOMONTH($B$20,ROW([@[Payment Period]])-ROW(LoanSchedule[[#Headers],[Payment Period]])-1)+DAY($B$20),"--"))

It works well if payment is monthly or $B$18 = 12. How can I modify the formula if Payment periods will be quarterly(4x year), yearly, or biweekly (26weeks), and list the corresponding months?如果按月付款或 $B$18 = 12,则效果很好。如果付款期为每季度(4x 年)、每年或每两周(26 周),并列出相应的月份,我该如何修改公式?

For example if I choose quarterly & $B$20 stays the same, the dates that will be displayed on the second column will be May 20, 2020;例如,如果我选择季度和 $B$20 保持不变,则第二列中显示的日期将为 2020 年 5 月 20 日; August 20, 2020, November 20, 2020, February 20, 2021, etc. if Biweekly, every 2 weeks. 2020年8月20日、2020年11月20日、2021年2月20日等,如果是双周一次,每2周一次。 Thanks for any help.谢谢你的帮助。

You need to translate the entries in B18 (number of pmts per year), and the payment period, into the number of months or days to add to the original date.您需要将 B18 中的条目(每年 pmts 数)和付款期转换为月数或天数以添加到原始日期。

I translated {1,4,12} using a lookup table with vlookup, handling 26 separately for the 14 day interval (2 weeks).我使用带有 vlookup 的查找表翻译了 {1,4,12},在 14 天间隔(2 周)内分别处理 26 个。

I chose this method because merely dividing 12/$B$18 would require a more complex formula should the result of the division not be an integer, since payments would then not be at monthly intervals我选择这种方法是因为如果除法的结果不是整数,仅仅除以12/$B$18就需要一个更复杂的公式,因为付款将不会按月进行

=IF($B$18=26,$B$20+14*[@[Payment Period]],
EDATE($B$20,VLOOKUP($B$18,{1,12;4,3;12,1},2,FALSE)*[@[Payment Period]]))

B18 = 12 B18 = 12

在此处输入图片说明

B18=4 B18=4

在此处输入图片说明

B18=26 B18=26

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM