Excel NETWORKDAYS part 3: calculating custom weekends with Power Query

In the previous 2 videos we’ve looked at calculating NETWORKDAYS and days off that aren’t just Saturday and Sunday. Thanks for Bill Szysz, Wayne Edmondson, XLarium and others for leading a lively discussion and offering really cool formula-based solutions. (The conversation is on this video: https://youtu.be/njC1AvEU3fg)

In this video I show you something I learned from Wayne and Bill. You can create your custom weekends by putting together a string of 1s and 0s that represent each weekday.

1 = day off
0 = workday
The string starts with Monday.

If you work (or go to school) only on Tuesdays and Wednesdays, your string would look like this:
“1010111”
Thus:

=NETWORKDAYS.INTL(Start_Date, End_Date, “1010111”, [Holidays])

You’ll also see Power Query, replace values and merge columns in order to simplify calculating net work days in Excel.

For a list of my Excel courses at Lynda/LinkedIn:
https://www.linkedin.com/learning/instructors/oz-du-soleil
There are courses on Power Query, Good spreadsheet habits, and a weekly Excel challenge that comes out every Friday.
Website: https://ozdusoleil.com

My book: Guerrilla Data Analysis 2nd Edition

My old blog: http://datascopic.net/blog-2-2

Calculating NETWORKDAYS when people work just 1 to 4 days/wk or have non-consecutive days off

This video starts with a correction from my previous video. I was wrong about how NETWORKDAYS works and I should have used NETWORKDAYS.INTL because it allows for “weekends” that are other than Saturday-Sunday. Thus, if you work at a restaurant that’s only open Tuesday thru Sunday, NETWORKDAYS.INTL will let you choose Monday as your weekend.

Now, here’s a challenge. What about part-time people who work Mondays, Wednesdays and Fridays? Or! When I was living in California, I worked 4 days, 10 hours each, for a full 40 hours. I loved working Monday, Tuesday, Thursday Friday. I was off on Wednesdays, Saturdays and Sundays.

To calculate the net work days in such situations NETWORKDAYS.INTL can’t help us.

In this video I show how to achieve this by using Power Query (unpivot), FILTER and COUNTIF. I also make clever use of the MATCH function to identify holidays.

#NETWORKDAYS
#3DayWeekends
#FILTERfunction

For a list of my Excel courses at Lynda/LinkedIn:
https://www.linkedin.com/learning/instructors/oz-du-soleil
There are courses on Power Query, Good spreadsheet habits, and a weekly Excel challenge that comes out every Friday.

Website: https://ozdusoleil.com

My book: Guerrilla Data Analysis 2nd Edition

My old blog: http://datascopic.net/blog-2-2

NETWORKDAYS Function | Calculating Net Work Days in Power Query | Weirdness & Warnings

Santosh asked about NETWORKDAYS and calculating net work days in Power Query. OUCH! This was rough.

NETWORKDAYS is a weird function. If you work at a restaurant that’s open 7 days/wk or a salon that’s closed on Mondays and Tuesdays, NETWORKDAYS makes a mess. However, using Power Query can be complicated with a lot of steps, but it’s more accurate than fiddling around with NETWORKDAYS.

This video has several phases:
0:00 Introduction
2:22 The NETWORKDAYS function
4:46 Calculating Net Work Days in Power Query
12:40 Outro

Download the file:
https://datascopic.net/wp-content/uploads/2021/06/NETWORKDAYS-PQ.xlsx
#NETWORKDAYS
#POWERQUERY
#Anti-Join
For a list of my Excel courses at Lynda/LinkedIn:
https://www.linkedin.com/learning/instructors/oz-du-soleil
There are courses on Power Query, Good spreadsheet habits, and a weekly Excel challenge that comes out every Friday.

Website: https://ozdusoleil.com

My book: Guerrilla Data Analysis 2nd Edition

My old blog: http://datascopic.net/blog-2-2

Power Query: Handling Percentages & Percent Totals

(NOTE: This replaces a previous video that had audio problems.)

Calculating percentages in Power Query is not as easy as it is in native Excel.

– First, when using the interface to calculate values in 2 different columns, you have to select the columns in the right order.
– Second, If you have a column of amounts and want to get each entry’s percentage of the total, that’s not straightforward. We end up making a parameter of the total and then calculate the percentages using that parameter.

#PowerQuery
#Percentages
#PercentTotals

For a list of my Excel courses at Lynda/LinkedIn:
https://www.linkedin.com/learning/instructors/oz-du-soleil
There are courses on Power Query, Good spreadsheet habits, and a weekly Excel challenge that comes out every Friday.

Website: https://ozdusoleil.com

My book: Guerrilla Data Analysis 2nd Edition

My old blog: http://datascopic.net/blog-2-2

Power Query: Handling Percentages & Percent Totals

Calculating percentages in Power Query is not as easy as it is in native Excel.

– First, when using the interface to calculate values in 2 different columns, you have to select the columns in the right order.
– Second, If you have a column of amounts and want to get each entry’s percentage of the total, that’s not straightforward. We end up making a parameter of the total and then calculate the percentages using that parameter.

#PowerQuery
#Percentages
#PercentTotals

For a list of my Excel courses at Lynda/LinkedIn:
https://www.linkedin.com/learning/instructors/oz-du-soleil
There are courses on Power Query, Good spreadsheet habits, and a weekly Excel challenge that comes out every Friday.

Website: https://ozdusoleil.com

My book: Guerrilla Data Analysis 2nd Edition

My old blog: http://datascopic.net/blog-2-2

Identify 2 partial strings of data in 1 cell | Text.Contains | Cross Join | Power Query

Someone asked about identifying more than 1 partial string of text in a cell. Hmmm … interesting.
Well, we go back to our old friends Cross-Join and Text.Combine in Power Query to help us out.

Download the workbook: https://datascopic.net/2Strings

#Text.Combine
#CrossJoin
#PartialText

For a list of my Excel courses at Lynda/LinkedIn:
https://www.linkedin.com/learning/instructors/oz-du-soleil
There are courses on Power Query, Good spreadsheet habits, and a weekly Excel challenge that comes out every Friday.

Website: https://ozdusoleil.com

My book: Guerrilla Data Analysis 2nd Edition

My old blog: http://datascopic.net/blog-2-2

Oz du Soleil: Risk Taking as a Content Creator | Global Excel Summit

If you missed the 2021 Global Excel Summit, full event content now available via the event website
πŸ‘‰ https://globalexcelsummit.com/

This video is my presentation: Risk Taking as a Content Creator

#GlobalExcelSummit
#ContentCreation
#RiskTaking

For a list of my Excel courses at Lynda/LinkedIn:
https://www.linkedin.com/learning/instructors/oz-du-soleil
There are courses on Power Query, Good spreadsheet habits, and a weekly Excel challenge that comes out every Friday.
Website: https://ozdusoleil.com
My book: Guerrilla Data Analysis 2nd Edition

My old blog: http://datascopic.net/blog-2-2

NEW FEATURE! Import Dynamic Arrays into Power Query + 8 Warnings

Just 2 days ago it became possible to import Dynamic Arrays into Power Query. πŸ™πŸΌπŸŽ‰
This is really cool. HOWEVER! There are 8 warnings that I take you through.

First. There is no longer “table-slash-range.” The icon has been changed to “From Sheet.” BOOOO! πŸ€ͺ Table/range seems more accurate.

Check out the video for the other 7 warnings. They’re too hard to explain. You just have to see them.

#DynamicArrays
#ImportFromDynamicArrays
#Power Query

For a list of my Excel courses at Lynda/LinkedIn:
https://www.linkedin.com/learning/instructors/oz-du-soleil
There are courses on Power Query, Good spreadsheet habits, and a weekly Excel challenge that comes out every Friday.

Website: https://ozdusoleil.com

My book: Guerrilla Data Analysis 2nd Edition

My old blog: http://datascopic.net/blog-2-2

NEW FEATURE! Import Dynamic Arrays into Power Query + 8 Warnings

Just 2 days ago it became possible to import Dynamic Arrays into Power Query. πŸ™πŸΌπŸŽ‰
This is really cool. HOWEVER! There are 8 warnings that I take you through.

First. There is no longer “table-slash-range.” The icon has been changed to “From Sheet.” BOOOO! πŸ€ͺ Table/range seems more accurate.

Check out the video for the other 7 warnings. They’re too hard to explain. You just have to see them.

#DynamicArrays
#ImportFromDynamicArrays
#Power Query

For a list of my Excel courses at Lynda/LinkedIn:
https://www.linkedin.com/learning/instructors/oz-du-soleil
There are courses on Power Query, Good spreadsheet habits, and a weekly Excel challenge that comes out every Friday.

Website: https://ozdusoleil.com

My book: Guerrilla Data Analysis 2nd Edition

My old blog: http://datascopic.net/blog-2-2