Array Formula to Generate Bimonthly Dates in Google Sheets

Published on

To generate bimonthly sequential dates likes 01-Jan-2020, 16-Jan-2020, 01-Feb-2020, 16-Feb-2020 and so on in a column or row in Google Sheets, we can use the SEQUENCE function with the FILTER function.

The above-said combination formula will populate the bimonthly dates in ascending order.

But if you want the bimonthly dates in descending order, I mean the dates in order like 01-Jan-2020, 16-Dec-2019, 01-Dece-2019 and so on, then we can use the SORT function additionally.

Also instead of 01 and 16, you can prefer any other bimonthly dates for example 7 and 23 like 07-Jan-2020, 23-Jan-2020, 07-Feb-2020, 23-Feb-2020 and so on. The formula is flexible enough for this change.

How to Get Bimonthly Dates in Ascending Order in Google Sheets

Bimonthly Dates in a Column (Asc)

Enter the below array formula in any blank column, for example in cell C2.

=filter(sequence(365,1,date(2020,1,1),1),(day(sequence(365,1,date(2020,1,1),1))=16)+(day(sequence(365,1,date(2020,1,1),1))=1))

It will generate a list of date values. Select the date values (column C) and format it to dates from the format menu (Format > Number > Date).

The above array formula will generate the bimonthly sequential dates in Google Sheets from 01-Jan-2020 to 16-Dec-2020.

Generate Bimonthly Sequential Dates in Google Sheets

I will explain later how to edit this formula for different periods.

Bimonthly Dates in a Row (Asc)

Assume you want to create a Gantt chart template in Google Sheets.

You may have tasks start and end dates in two columns (B:C) and a row (D2:2) contains dates (daily, weekly, monthly, or fortnight bases) to draw the bar.

Weekly Sch - Dates in Row

If the schedule is on a fortnight basis (in the above image it’s in weekly basis), then you may want to generate the bimonthly dates in a row.

In such a case, use TRANSPOSE with the above formula to get the output in a row.

=transpose(filter(sequence(365,1,date(2020,1,1),1),(day(sequence(365,1,date(2020,1,1),1))=16)+(day(sequence(365,1,date(2020,1,1),1))=1)))

But if you know the SEQUENCE arguments, then you can avoid using TRANSPOSE by modifying the formula a little.

Syntax: SEQUENCE(rows, [columns], [start], [step])

What you want to do is change the value used in ‘rows’ with ‘columns’ and the values used in ‘columns’ with ‘rows’. I mean replace 1 with 365 and 365 with 1 as below.

=filter(sequence(1,365,date(2020,1,1),1),(day(sequence(1,365,date(2020,1,1),1))=16)+(day(sequence(1,365,date(2020,1,1),1))=1))

The above formula will generate bimonthly sequential dates in a row.

How to Modify the Formula?

Let me try to explain how to modify the formula to populate different bimonthly dates like;

  1. Different start and end month.
  2. Different dates (other two dates instead of 1 and 16).
Bimonthly - Formula Explanation

I think, with the help of the image, the formula seems easy for you to understand. Find more details below.

Legends and Explanation

Red Color: To get sequential bimonthly dates from 01-Jun-2020, change date(2020,1,1) which appears thrice in the formula with date(2020,6,1). The formula will return the dates from 01-Jun-2020 to 16-May-2021.

Green Color: Assume you have done the changes above (mentioned against red color). To get the dates only up to 16-Dec-2020 instead of 16-May-2021, you must change 365 in the formula with 213 that also thrice.

How I have come to this number?

Find the number of days (date difference) from 01-Jun-2020 to 31-Dec-2020 using the DAYS function below.

=days(date(2020,12,31),date(2020,6,1))

Yellow Color: To get different bimonthly dates, replace 1 and 16 in the formula. For example, replace 1 and 16 with 7 and 23 and check the changes in the output

How to Get Bimonthly Dates in Descending Order in Google Sheets

Assume I want to get the dates from December 2020 to January 2020, that means dates in descending order. What we want to do is, use the start date as 01-Jan-2020 and 365 in the formula.

I mean use the same earlier formula. Then wrap it with SORT. How?

Generic Formula:

=sort(bimonthly_formula,1,0)

So the formula will be;

In a Column:

=sort(filter(sequence(365,1,date(2020,1,1),1),(day(sequence(365,1,date(2020,1,1),1))=16)+(day(sequence(365,1,date(2020,1,1),1))=1)),1,0)

In a Row:

We need to use the TRANSPOSE here as SORT won’t work in a row.

=transpose(sort(transpose(filter(sequence(1,365,date(2020,1,1),1),(day(sequence(1,365,date(2020,1,1),1))=16)+(day(sequence(1,365,date(2020,1,1),1))=1))),1,0))

Formula Logic

To generate bimonthly sequential dates in Google Sheets I have used simple logic. It’s as follows.

The SEQUENCE formula generates sequential dates like 1-Jan-2020, 2-Jan-2020 and so on. The FILTER formula filters the dates 1 and 16.

Additional Resources

Prashanth KV
Prashanth KV
Your Trusted Google Sheets and Excel Guide Prashanth KV brings a wealth of experience in Google Sheets and Excel, cultivated through years of work with multinational corporations in Mumbai and Dubai. As a recognized Google Product Expert in Docs Editors, Prashanth shares his expertise through insightful blogging since 2012. Explore his blog for practical tips and guidance on maximizing your spreadsheet skills.

Hierarchical Numbering Sequences in Excel

Creating hierarchical numbering sequences in an Excel spreadsheet can significantly improve the way you...

How to Easily Repeat a Sequence of Numbers in Excel

Excel offers multiple ways to accomplish tasks, and the simplicity of each approach depends...

Create a Sequence of Dates at Every Nth Row in Excel (Dynamic Array)

Would you like to create a sequence of dates in every nth row in...

XMATCH Row by Row: Finding Values Across a Range in Google Sheets

Using the BYROW function with XMATCH in Google Sheets allows us to match values...

More like this

XMATCH Row by Row: Finding Values Across a Range in Google Sheets

Using the BYROW function with XMATCH in Google Sheets allows us to match values...

Limit Formula Expansion to a Specific Row in Google Sheets

In this tutorial, I’ll explain how to limit the expansion of an array formula...

3-D Referencing Structured Data Tables in Google Sheets

When you have several tables within a single sheet—not across multiple sheets in a...

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.