HomeGoogle DocsSpreadsheetArray Formula to Generate Bimonthly Dates in Google Sheets

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.

SORT and SORTBY – Excel Vs Google Sheets

While Excel offers the SORT and SORTBY functions for sorting a table, Google Sheets...

Get Top N Values Using Excel’s FILTER Function

When using the FILTER function in Excel to extract the top N values, it's...

XLOOKUP in Excel: Working with Visible Rows in a Table

In Excel, the XLOOKUP function isn't inherently designed to exclusively work with visible rows;...

SUMPRODUCT Differences: Excel vs. Google Sheets

The core purpose of the SUMPRODUCT function remains consistent across both Excel and Google...

More like this

Interactive Random Task Assigner in Google Sheets

You have multiple tasks and multiple people. Here's a fun way to randomly assign...

Google Sheets Bar and Column Chart with Target Coloring

To color each data point in the column or bar chart according to the...

Analyzing Column A Between Non-Adjacent Values in Column B: Google Sheets

This tutorial addresses a common scenario encountered in Google Sheets: how to sum, average,...

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.