0% found this document useful (0 votes)
31 views58 pages

The Ultimate Guide to Functions in Power Query: Turn Raw Data into Actionable Insights 1st Edition Omid Motamedisedeh instant download

The document is a guide titled 'The Ultimate Guide to Functions in Power Query' by Omid Motamedisedeh, which focuses on transforming raw data into actionable insights using Power Query. It covers various topics including data types, number functions, text functions, date and time functions, and list functions, providing detailed explanations and examples. The guide is aimed at helping users effectively utilize Power Query in Excel and Power BI.

Uploaded by

easssafhoc511
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views58 pages

The Ultimate Guide to Functions in Power Query: Turn Raw Data into Actionable Insights 1st Edition Omid Motamedisedeh instant download

The document is a guide titled 'The Ultimate Guide to Functions in Power Query' by Omid Motamedisedeh, which focuses on transforming raw data into actionable insights using Power Query. It covers various topics including data types, number functions, text functions, date and time functions, and list functions, providing detailed explanations and examples. The guide is aimed at helping users effectively utilize Power Query in Excel and Power BI.

Uploaded by

easssafhoc511
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 58

The Ultimate Guide to Functions in Power Query: Turn

Raw Data into Actionable Insights 1st Edition Omid


Motamedisedeh download pdf

https://ebookmass.com/product/the-ultimate-guide-to-functions-in-power-
query-turn-raw-data-into-actionable-insights-1st-edition-omid-
motamedisedeh/

Visit ebookmass.com today to download the complete set of


ebook or textbook!
Here are some recommended products for you. Click the link to
download, or explore more at ebookmass.com

The Ultimate Guide to Functions in Power Query Omid


Motamedisedeh

https://ebookmass.com/product/the-ultimate-guide-to-functions-in-
power-query-omid-motamedisedeh/

PostgreSQL Query Optimization: The Ultimate Guide to


Building Efficient Queries 2nd Edition Dombrovskaya

https://ebookmass.com/product/postgresql-query-optimization-the-
ultimate-guide-to-building-efficient-queries-2nd-edition-dombrovskaya/

PostgreSQL Query Optimization: The Ultimate Guide to


Building Efficient Queries 2 / converted Edition Henrietta
Dombrovskaya
https://ebookmass.com/product/postgresql-query-optimization-the-
ultimate-guide-to-building-efficient-queries-2-converted-edition-
henrietta-dombrovskaya/

Visual Data Insights Using SAS ODS Graphics: A Guide to


Communication-Effective Data Visualization 1st Edition
Leroy Bessler
https://ebookmass.com/product/visual-data-insights-using-sas-ods-
graphics-a-guide-to-communication-effective-data-visualization-1st-
edition-leroy-bessler-2/
Visual Data Insights Using SAS ODS Graphics: A Guide to
Communication-Effective Data Visualization 1st Edition
Leroy Bessler
https://ebookmass.com/product/visual-data-insights-using-sas-ods-
graphics-a-guide-to-communication-effective-data-visualization-1st-
edition-leroy-bessler/

The Ultimate Kid's Guide to the Universe Jenny Marder

https://ebookmass.com/product/the-ultimate-kids-guide-to-the-universe-
jenny-marder/

Leveling Up with SQL: Advanced Techniques for Transforming


Data into Insights Mark Simon

https://ebookmass.com/product/leveling-up-with-sql-advanced-
techniques-for-transforming-data-into-insights-mark-simon/

Microsoft Excel Power Pivot & Power Query For Dummies, 2nd
Edition Michael Alexander

https://ebookmass.com/product/microsoft-excel-power-pivot-power-query-
for-dummies-2nd-edition-michael-alexander/

Make Your Data Speak: Creating Actionable Data through


Excel For Non-Technical Professionals 1st Edition Alex
Kolokolov
https://ebookmass.com/product/make-your-data-speak-creating-
actionable-data-through-excel-for-non-technical-professionals-1st-
edition-alex-kolokolov/
The Ultimate
Guide to Functions
in Power Query
Turn Raw Data into
Actionable Insights

Omid Motamedisedeh
The Ultimate Guide to
Functions in Power
Query
Turn Raw Data into
Actionable Insights

Omid Motamedisedeh
The Ultimate Guide to Functions in Power Query: Turn Raw Data into
Actionable Insights

Omid Motamedisedeh
Brisbane, QLD, Australia

ISBN-13 (pbk): 978-1-4842-9753-7 ISBN-13 (electronic): 978-1-4842-9754-4


https://doi.org/10.1007/978-1-4842-9754-4

Copyright © 2024 by Omid Motamedisedeh


This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or
part of the material is concerned, specifically the rights of translation, reprinting, reuse of
illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way,
and transmission or information storage and retrieval, electronic adaptation, computer software,
or by similar or dissimilar methodology now known or hereafter developed.
Trademarked names, logos, and images may appear in this book. Rather than use a trademark
symbol with every occurrence of a trademarked name, logo, or image we use the names, logos,
and images only in an editorial fashion and to the benefit of the trademark owner, with no
intention of infringement of the trademark.
The use in this publication of trade names, trademarks, service marks, and similar terms, even if
they are not identified as such, is not to be taken as an expression of opinion as to whether or not
they are subject to proprietary rights.
While the advice and information in this book are believed to be true and accurate at the date of
publication, neither the authors nor the editors nor the publisher can accept any legal
responsibility for any errors or omissions that may be made. The publisher makes no warranty,
express or implied, with respect to the material contained herein.
Managing Director, Apress Media LLC: Welmoed Spahr
Acquisitions Editor: Susan McDermott
Development Editor: Laura Berendson
Editorial Project Manager: Jessica Vakili
Copy Editor: Mary Behr
Cover designed by eStudioCalamar
Cover image by Jordy from Pixabay
Distributed to the book trade worldwide by Springer Science+Business Media New York, 1
New York Plaza, Suite 4600, New York, NY 10004-1562, USA. Phone 1-800-SPRINGER, fax (201)
348-4505, e-mail [email protected], or visit www.springeronline.com. Apress Media,
LLC is a California LLC and the sole member (owner) is Springer Science + Business Media
Finance Inc (SSBM Finance Inc). SSBM Finance Inc is a Delaware corporation.
For information on translations, please e-mail [email protected]; for
reprint, paperback, or audio rights, please e-mail [email protected].
Apress titles may be purchased in bulk for academic, corporate, or promotional use. eBook
versions and licenses are also available for most titles. For more information, reference our Print
and eBook Bulk Sales web page at www.apress.com/bulk-sales.
Any source code or other supplementary material referenced by the author in this book is
available to readers on GitHub (github.com/apress). For more detailed information, please visit
https://www.apress.com/gp/services/source-code.
Paper in this product is recyclable
To my dear mom and dad, in heartfelt appreciation for
your invaluable support and assistance
Table of Contents
About the Author������������������������������������������������������������������������������xvii

About the Technical Reviewer�����������������������������������������������������������xix

Acknowledgments�����������������������������������������������������������������������������xxi

Introduction�������������������������������������������������������������������������������������xxiii

Chapter 1: Introduction to Power Query�����������������������������������������������1


Introduction to Power Query���������������������������������������������������������������������������������2
Power Query in Excel��������������������������������������������������������������������������������������������4
Power Query in Power BI������������������������������������������������������������������������������������13
Power Query Interface�����������������������������������������������������������������������������������15
M Code����������������������������������������������������������������������������������������������������������������16
Conclusion����������������������������������������������������������������������������������������������������������21

Chapter 2: Data Types�������������������������������������������������������������������������23


Data Types in Power Query���������������������������������������������������������������������������������23
Null����������������������������������������������������������������������������������������������������������������25
Logical Values������������������������������������������������������������������������������������������������25
Numbers��������������������������������������������������������������������������������������������������������26
Time and Date�����������������������������������������������������������������������������������������������27
Text����������������������������������������������������������������������������������������������������������������30
Binary������������������������������������������������������������������������������������������������������������30
List�����������������������������������������������������������������������������������������������������������������30
Record�����������������������������������������������������������������������������������������������������������31

v
Table of Contents

Table��������������������������������������������������������������������������������������������������������������31
Function���������������������������������������������������������������������������������������������������������31
Type Conversion��������������������������������������������������������������������������������������������������32
Converting Values to the Number Format������������������������������������������������������33
Converting Values to the Text Format������������������������������������������������������������34
Converting Values to the Date and Time Format�������������������������������������������35
Converting Values to the Record Format�������������������������������������������������������35
Conclusion����������������������������������������������������������������������������������������������������������36

Chapter 3: Number Functions�������������������������������������������������������������37


Constant Values��������������������������������������������������������������������������������������������������37
Information Functions�����������������������������������������������������������������������������������������38
Rounding Operation��������������������������������������������������������������������������������������������39
Mathematical Operations������������������������������������������������������������������������������������43
Random Generation��������������������������������������������������������������������������������������������45
Trigonometry�������������������������������������������������������������������������������������������������������45
Conclusion����������������������������������������������������������������������������������������������������������45

Chapter 4: Text Functions�������������������������������������������������������������������47


Extracting Part of a Text��������������������������������������������������������������������������������������48
Text.At������������������������������������������������������������������������������������������������������������48
Text.Start�������������������������������������������������������������������������������������������������������49
Text.End���������������������������������������������������������������������������������������������������������50
Text.Range�����������������������������������������������������������������������������������������������������51
Text.AfterDelimiter�����������������������������������������������������������������������������������������52
Text.BeforeDelimiter��������������������������������������������������������������������������������������55
Text.BetweenDelimiters���������������������������������������������������������������������������������57
Text.Select�����������������������������������������������������������������������������������������������������59
Text.Split��������������������������������������������������������������������������������������������������������60

vi
Table of Contents

Removing, Replacing, and Combining Texts��������������������������������������������������������61


Text.Remove��������������������������������������������������������������������������������������������������61
Text.RemoveRange����������������������������������������������������������������������������������������62
Text.PadEnd���������������������������������������������������������������������������������������������������63
Text.PadStart�������������������������������������������������������������������������������������������������65
Text.Replace��������������������������������������������������������������������������������������������������66
Text.ReplaceRange����������������������������������������������������������������������������������������67
Text.Insert������������������������������������������������������������������������������������������������������68
Text.Repeat����������������������������������������������������������������������������������������������������69
Text.Combine�������������������������������������������������������������������������������������������������69
Text Correction����������������������������������������������������������������������������������������������������70
Searching for Characters������������������������������������������������������������������������������������72
Text.StartsWith����������������������������������������������������������������������������������������������72
Text.EndsWith������������������������������������������������������������������������������������������������74
Text.Contains�������������������������������������������������������������������������������������������������75
Text.PositionOf�����������������������������������������������������������������������������������������������76
Text.PositionOfAny�����������������������������������������������������������������������������������������78
Text Conversion���������������������������������������������������������������������������������������������������79
Summary������������������������������������������������������������������������������������������������������������81

Chapter 5: Date and Time Functions���������������������������������������������������83


Date Information�������������������������������������������������������������������������������������������������84
DateTime Information�����������������������������������������������������������������������������������������87
Adding a Value to a Date�������������������������������������������������������������������������������������89
Shifting Dates�����������������������������������������������������������������������������������������������������90
Conversion to Record������������������������������������������������������������������������������������������93
Date Specifications���������������������������������������������������������������������������������������������94

vii
Table of Contents

Date.Day��������������������������������������������������������������������������������������������������������94
Date.DayOfWeek��������������������������������������������������������������������������������������������94
Date.DayOfWeekName�����������������������������������������������������������������������������������95
Date.WeekOfMonth����������������������������������������������������������������������������������������95
Date.WeekOfYear�������������������������������������������������������������������������������������������96
Date.Month����������������������������������������������������������������������������������������������������96
Date.MonthName�������������������������������������������������������������������������������������������97
Date.DayOfYear����������������������������������������������������������������������������������������������97
Date.Year�������������������������������������������������������������������������������������������������������98
Summary������������������������������������������������������������������������������������������������������������98

Chapter 6: List Functions��������������������������������������������������������������������99


Defining a List in Power Query��������������������������������������������������������������������������100
List.Numbers�����������������������������������������������������������������������������������������������103
List.Generate�����������������������������������������������������������������������������������������������104
List.Times����������������������������������������������������������������������������������������������������108
List.Dates�����������������������������������������������������������������������������������������������������109
List.DateTimes���������������������������������������������������������������������������������������������110
List.Random�������������������������������������������������������������������������������������������������111
Sorting Values in a List��������������������������������������������������������������������������������������112
List.Reverse�������������������������������������������������������������������������������������������������112
List.Sort�������������������������������������������������������������������������������������������������������113
Extracting from a List����������������������������������������������������������������������������������������115
List.First and List.Last���������������������������������������������������������������������������������115
List.FirstN and List.LastN����������������������������������������������������������������������������116
List.Range����������������������������������������������������������������������������������������������������118
List.Max and List.Min����������������������������������������������������������������������������������119
List.MaxN and List.MinN������������������������������������������������������������������������������120

viii
Table of Contents

List.Select����������������������������������������������������������������������������������������������������122
List.FindText������������������������������������������������������������������������������������������������123
Removing Values in a List���������������������������������������������������������������������������������124
List.RemoveNull�������������������������������������������������������������������������������������������124
List.Distinct��������������������������������������������������������������������������������������������������125
List.RemoveFirsN and List.RemoveLastN����������������������������������������������������126
List.RemoveRange���������������������������������������������������������������������������������������127
List.RemoveItems����������������������������������������������������������������������������������������128
List.Skip�������������������������������������������������������������������������������������������������������129
List.Alternate�����������������������������������������������������������������������������������������������129
List Merging������������������������������������������������������������������������������������������������������131
List.Combine������������������������������������������������������������������������������������������������131
List.InsertRange������������������������������������������������������������������������������������������132
List.Zip���������������������������������������������������������������������������������������������������������133
List.Union�����������������������������������������������������������������������������������������������������133
List.Intersect������������������������������������������������������������������������������������������������134
List.Difference���������������������������������������������������������������������������������������������135
Mathematical Calculations on the Data of a List����������������������������������������������136
List Information Functions��������������������������������������������������������������������������������139
List.IsEmpty�������������������������������������������������������������������������������������������������140
List.IsDistinct�����������������������������������������������������������������������������������������������140
List.Contains������������������������������������������������������������������������������������������������141
List.ContainsAll��������������������������������������������������������������������������������������������142
List.ContainsAny������������������������������������������������������������������������������������������143
List.AllTrue���������������������������������������������������������������������������������������������������144
List.AnyTrue�������������������������������������������������������������������������������������������������144

ix
Table of Contents

Positions in a List����������������������������������������������������������������������������������������������144
List.Positions�����������������������������������������������������������������������������������������������145
List.PositionOf���������������������������������������������������������������������������������������������145
List.PositionOfAny����������������������������������������������������������������������������������������147
Replacing and Transforming Values������������������������������������������������������������������148
List.ReplaceValue����������������������������������������������������������������������������������������148
List.ReplaceMatchingItems�������������������������������������������������������������������������149
List.ReplaceRange���������������������������������������������������������������������������������������151
List.Transform����������������������������������������������������������������������������������������������152
List.TransformMany�������������������������������������������������������������������������������������153
Other Functions�������������������������������������������������������������������������������������������������154
List.Single����������������������������������������������������������������������������������������������������154
List.SingleOrDefault�������������������������������������������������������������������������������������154
List.Repeat���������������������������������������������������������������������������������������������������155
List.Split�������������������������������������������������������������������������������������������������������156
Summary����������������������������������������������������������������������������������������������������������157

Chapter 7: Records���������������������������������������������������������������������������159
Defining a Record���������������������������������������������������������������������������������������������159
Record Properties���������������������������������������������������������������������������������������������162
Record.FieldCount���������������������������������������������������������������������������������������162
Record.FieldNames�������������������������������������������������������������������������������������163
Record.FieldValues��������������������������������������������������������������������������������������163
Record.ToList�����������������������������������������������������������������������������������������������164
Record.Field������������������������������������������������������������������������������������������������164
Record.FieldOrDefault���������������������������������������������������������������������������������165
Record.HasFields�����������������������������������������������������������������������������������������166

x
Visit https://ebookmass.com today to explore
a vast collection of ebooks across various
genres, available in popular formats like
PDF, EPUB, and MOBI, fully compatible with
all devices. Enjoy a seamless reading
experience and effortlessly download high-
quality materials in just a few simple steps.
Plus, don’t miss out on exciting offers that
let you access a wealth of knowledge at the
best prices!
Table of Contents

Record Correction���������������������������������������������������������������������������������������������167
Record.AddField������������������������������������������������������������������������������������������167
Record.Combine������������������������������������������������������������������������������������������168
Record.SelectFields�������������������������������������������������������������������������������������168
Record.RemoveFields����������������������������������������������������������������������������������170
Record.RenameFields����������������������������������������������������������������������������������172
Record.ReorderFields����������������������������������������������������������������������������������173
Record.TransformFields�������������������������������������������������������������������������������174
Record Conversion��������������������������������������������������������������������������������������������175
Record.FromList������������������������������������������������������������������������������������������175
Record.FromTable����������������������������������������������������������������������������������������176
Record.ToTable��������������������������������������������������������������������������������������������177
Summary����������������������������������������������������������������������������������������������������������177

Chapter 8: Tables������������������������������������������������������������������������������179
Creating a Table������������������������������������������������������������������������������������������������180
Table.FromColumns�������������������������������������������������������������������������������������180
Table.FromRows������������������������������������������������������������������������������������������182
Table.FromRecords��������������������������������������������������������������������������������������185
Table.FromValue������������������������������������������������������������������������������������������187
Table Conversion�����������������������������������������������������������������������������������������������189
Table.ToRecords�������������������������������������������������������������������������������������������190
Table.ToColumns������������������������������������������������������������������������������������������190
Table.ToRows�����������������������������������������������������������������������������������������������191
Table.ToList��������������������������������������������������������������������������������������������������192
Table.Column�����������������������������������������������������������������������������������������������193
Table.TransformRows����������������������������������������������������������������������������������194
Table.Split����������������������������������������������������������������������������������������������������195
Table.SplitAt�������������������������������������������������������������������������������������������������196

xi
Table of Contents

Information��������������������������������������������������������������������������������������������������������197
Selecting Table Rows����������������������������������������������������������������������������������������200
Table.FirstValue�������������������������������������������������������������������������������������������201
Table.First and Table.Last����������������������������������������������������������������������������201
Table.FirstN and Table.LastN������������������������������������������������������������������������202
Table.Max and Table.Min�����������������������������������������������������������������������������204
Table.MaxN and Table.MinN�������������������������������������������������������������������������206
Table.Range�������������������������������������������������������������������������������������������������208
Table.SelectRows����������������������������������������������������������������������������������������209
Table.SelectRowsWithErrors������������������������������������������������������������������������212
Deleting Table Rows������������������������������������������������������������������������������������������214
Table.RemoveFirstN and Table.RemoveLastN����������������������������������������������214
Table.Distinct�����������������������������������������������������������������������������������������������217
Table.Skip����������������������������������������������������������������������������������������������������219
Table.RemoveRows��������������������������������������������������������������������������������������221
Table.AlternateRows������������������������������������������������������������������������������������222
Table.RemoveRowsWithErrors���������������������������������������������������������������������224
Table.RemoveMatchingRows�����������������������������������������������������������������������225
Insert and Replace Table Rows�������������������������������������������������������������������������227
Table.InsertRows�����������������������������������������������������������������������������������������228
Table.ReplaceRows��������������������������������������������������������������������������������������229
Table.ReplaceMatchingRows�����������������������������������������������������������������������231
Table.Repeat������������������������������������������������������������������������������������������������232
Order of rows����������������������������������������������������������������������������������������������������234
Table.ReverseRows�������������������������������������������������������������������������������������234
Table.Sort�����������������������������������������������������������������������������������������������������235
Checking a Condition in All Rows����������������������������������������������������������������������238

xii
Table of Contents

Table.IsDistinct��������������������������������������������������������������������������������������������238
Table.MatchesAllRows���������������������������������������������������������������������������������239
Table.MatchesAnyRows�������������������������������������������������������������������������������241
Table.Contains���������������������������������������������������������������������������������������������242
Table.ContainsAll and Table.ContainsAny����������������������������������������������������244
Table.SingleRow������������������������������������������������������������������������������������������245
Column Names��������������������������������������������������������������������������������������������������246
Table.ColumnNames������������������������������������������������������������������������������������246
Table.DemoteHeaders����������������������������������������������������������������������������������246
Table.PromoteHeaders���������������������������������������������������������������������������������247
Table.HasColumns���������������������������������������������������������������������������������������249
Table.ColumnsOfType����������������������������������������������������������������������������������250
Table.PrefixColumns������������������������������������������������������������������������������������251
Table.RenameColumns��������������������������������������������������������������������������������252
Modifing columns���������������������������������������������������������������������������������������������255
Table.RemoveColumns��������������������������������������������������������������������������������256
Table.SelectColumns�����������������������������������������������������������������������������������259
Table.DuplicateColumn��������������������������������������������������������������������������������263
Table.TransformColumnTypes����������������������������������������������������������������������265
Table.TransformColumns�����������������������������������������������������������������������������267
Table.AddIndexColumn��������������������������������������������������������������������������������271
Table.AddColumn�����������������������������������������������������������������������������������������274
Table.AddRankColumn���������������������������������������������������������������������������������277
Table.SplitColumn����������������������������������������������������������������������������������������281
Table.CombineColumns�������������������������������������������������������������������������������285
Table.CombineColumnsToRecord����������������������������������������������������������������288
Table.ReorderColumns���������������������������������������������������������������������������������290
Table.Pivot���������������������������������������������������������������������������������������������������291

xiii
Table of Contents

Table.Unpivot�����������������������������������������������������������������������������������������������294
Table.Group��������������������������������������������������������������������������������������������������297
Table.Transpose�������������������������������������������������������������������������������������������301
Combining Tables����������������������������������������������������������������������������������������������303
Table.Combine���������������������������������������������������������������������������������������������303
Table.Join����������������������������������������������������������������������������������������������������308
Table.NestedJoin�����������������������������������������������������������������������������������������317
Expanding Columns������������������������������������������������������������������������������������������319
Table.ExpandListColumn������������������������������������������������������������������������������320
Table.ExpandRecordColumn������������������������������������������������������������������������322
Table.ExpandTableColumn���������������������������������������������������������������������������326
Table.AggregateTableColumn����������������������������������������������������������������������329
Replacing Column Values����������������������������������������������������������������������������������330
Table.FillDown and Table.FillUp�������������������������������������������������������������������331
Table.ReplaceErrorValues����������������������������������������������������������������������������334
Table.ReplaceValue��������������������������������������������������������������������������������������337
Finding a Value in a Table����������������������������������������������������������������������������������340
Table.FindText����������������������������������������������������������������������������������������������340
Table.PositionOf�������������������������������������������������������������������������������������������341
Table.PositionOfAny�������������������������������������������������������������������������������������344
Summary����������������������������������������������������������������������������������������������������������345

Chapter 9: Extracting from Data Sources�����������������������������������������347


Folder.Contents�������������������������������������������������������������������������������������������������348
Csv.Document���������������������������������������������������������������������������������������������������349
Excel.Workbook������������������������������������������������������������������������������������������������353
Pdf.Tables����������������������������������������������������������������������������������������������������������355
Sql.Database�����������������������������������������������������������������������������������������������������356

xiv
Table of Contents

Excel.CurrentWorkbook�������������������������������������������������������������������������������������357
Summary����������������������������������������������������������������������������������������������������������357

Chapter 10: Other Functions�������������������������������������������������������������359


if������������������������������������������������������������������������������������������������������������������������360
Combining Conditions����������������������������������������������������������������������������������362
The try Function������������������������������������������������������������������������������������������������366
The let-in Command������������������������������������������������������������������������������������368
Defining a New Function�����������������������������������������������������������������������������������375
Using Defined Function in Other Queries�����������������������������������������������������380

Index�������������������������������������������������������������������������������������������������383

xv
About the Author
Omid Motamedisedeh is a freelance data and
business intelligence analyst with a PhD in
Industrial Engineering. He’s currently working
towards his second PhD at Queensland
University of Technology. Omid is the author
of several articles in industry journals (Electric
Power Systems Research, Journal of Building
Engineering, Energy, Neural Computing and
Applications, and others), and seven books (all
in Farsi) namely Managing Data Entry in Excel by Data Validation, Data
Analysis by Excel’s Pivot Table, Power Query as The Magic of Excel, 222
Most Useful Functions in Excel 2016, Useful Excel Functions in Excel 2019,
Reference of Functions in Excel 2021, and From Drawing Charts to Creating
Dashboards in Excel 2016.

xvii
About the Technical Reviewer
Bo Rydobon (a.k.a. Excel Wizard) is a Microsoft Excel expert and YouTuber
from Thailand who is known for his speed and mastery of Excel. He is also
the creator of the Excel Wizard YouTube channel, where he shares tips and
tricks on how to use advanced dynamic arrays. He actively contributes
on Excelforum.com and became a Top 5 reputation within a few years.
His participation in the Excel BI LinkedIn Excel Challenge drew notable
attention due to his impressive response. In 2022, Bo Rydobon won the
Excel Esports Speedrun organized by the Financial Modeling World Cup.
Bo Rydobon is an inspiration to Excel users all over the world.
He shows that anyone can learn Excel and become an expert, regardless of
their background or experience.

xix
Acknowledgments
I would like to express my sincere gratitude to the individuals who have
played an indispensable role in supporting me throughout the process
of writing this book. My appreciation extends to both those within my
professional circle and those who hold a personal place in my life.
First and foremost, I extend heartfelt thanks to Faranak, whose
unwavering belief in me and encouragement provided the catalyst for
embarking on this writing journey.
I am equally grateful to Bo Rydobon, my esteemed technical reviewer,
whose invaluable insights and motivating feedback have significantly
enriched the quality of this work.
Furthermore, I wish to extend my thanks to the Apress team, including
Susan McDermott (Editorial Director), Shobana Srinivasan (Book
Coordinator), and Shaul Elson (Editorial Manager), for their commendable
professionalism and collaborative approach. Their contributions have
transformed working with Apress into a truly gratifying experience.
Lastly, my profound and enduring appreciation goes to Professor
Hamid Reza Irani, who imparted foundational knowledge of Excel during
my undergraduate years, and to Mike Girvin, a cherished Excel mentor.
Mike's prolific Excel tips shared on the ExcelIsFun YouTube channel have
been a wellspring of learning for all Excel fans like me.

xxi
Introduction
In today's data-driven landscape, the ability to seamlessly transform raw
data into meaningful insights is a skill of paramount importance. The
Ultimate Guide to Functions in Power Query stands as a beacon for Excel
and Power BI enthusiasts, equipping them with the tools to unlock the full
potential of their data manipulation endeavors.
In this comprehensive guide, you will delve into the world of Power
Query functions, the building blocks that empower users to effortlessly
manipulate, cleanse, and refine their data. Whether you're a seasoned
data professional or a novice user, this book is designed to elevate your
proficiency in harnessing the capabilities of Power Query functions,
ultimately enabling you to convert seemingly complex datasets into
actionable insights.
Join me on a journey through the intricacies of Power Query functions
as I demystify their functionalities, explore real-world use cases, and
provide step-by-step guidance on their application. With a meticulous
balance of theory and hands-on practice, The Ultimate Guide to Functions
in Power Query is not just a book; it's your indispensable companion in
mastering the art of data transformation.
Chapters include

1. “Introduction to Power Query:” Build a foundation


by learning what Power Query is, its role in data
transformation, and the fundamental concepts that
underpin its functionality.

xxiii
Introduction

2. “Formatting:” Explore the nuances of formatting


data, from standardizing text and numbers to
customizing visual elements.

3. “Number Functions:” Discover a wealth of functions


designed to manipulate and analyze numerical
data, from basic arithmetic operations to advanced
mathematical calculations.

4. “Text Functions:” Uncover the power of text


manipulation with functions that enable you
to extract, concatenate, and transform text in
various ways.

5. “Date and Time Functions:” Navigate the


complexities of date and time data with functions
that facilitate calculations, comparisons, and
conversions, ensuring accuracy in temporal
analysis.

6. “List Functions:” Learn how to work with lists


(ordered collections of values) using functions that
allow you to manipulate, filter, and transform list-­
based data structures.

7. “Record Functions:” Dive into the world of records


(structures that hold multiple fields of data) and
harness functions to modify, extract, and manage
record information.

8. “Table Functions:” Master the art of working with


tables, the heart of data manipulation in Power
Query, using functions that facilitate aggregation,
filtering, and transformation.

xxiv
Visit https://ebookmass.com today to explore
a vast collection of ebooks across various
genres, available in popular formats like
PDF, EPUB, and MOBI, fully compatible with
all devices. Enjoy a seamless reading
experience and effortlessly download high-
quality materials in just a few simple steps.
Plus, don’t miss out on exciting offers that
let you access a wealth of knowledge at the
best prices!
Exploring the Variety of Random
Documents with Different Content
introduction, or intimated to them, in the remotest manner, his
disapprobation: or spoke any where against baptism as administered by
his harbinger, John the baptist, as if it were a piece of superstition—or
an empty form: but he received it himself, which is at least a
presumptive argument, that water-baptism was to be an ordinance in
his religion; for John came to prepare the way of the Lord, in all
respects, and to dispose people in their minds, to receive the Christian
System; but if there were to be no christian baptism, how could John’s
baptizing unto repentance be from heaven or a preparation for the
introduction of the Gospel-System? If Jesus Christ designed to have no
such ordinance, to be a standing ordinance, in his Church, to the end
of the world, we should have had, we rationally suppose, some direct or
implied hint at least of his dislike of baptizing with water. For when he
gave his eleven disciples, and virtually, in them, all his true Ministers,
the commission in the text, go teach all nations, baptizing them, in the
name of the Father—and of the Son, and of the holy Ghost, they could
not understand him, but as instituting and appointing the ordinance of
water-baptism. As they had been universally, during his public
Ministry, in the practice of it, if he had intended to have the practise
discontinued, he would have told them so:—he would have forbid
them to continue it, and told them it was an idle ceremony—a perfectly
useless and insignificant rite—no better than old Jewish fables—and
wholly unbecoming the nature of his own spiritual religion. But there is
not a word of this. On the other hand he, in the most solemn manner
possible, commanded them to go and baptize all that should embrace
his religion, professedly, throughout the world. And after being
endowed with power from on high, on the day of Pentecost, or baptized
with the holy Ghost, that is, invested with his miraculous gifts, they
continued to dispense the ordinance of water-baptism, as they had
done before. As they gathered and organized Churches over the world,
and preached Christ and him crucified, they dispensed water-baptism
to all their converts, not one excepted, that we hear of, or know of: and
so careful were they about this matter that they even baptized some of
John’s disciples over again. In the progress of their labours, they
gathered an immense number of churches in Asia, in Europe, in Africa,
in all parts of the then known world. And they were uniform in their
practice. All the churches were formed doubtless upon the same
model. They did not practise baptism in some instances, or omit it in
others. They administered it to all, as the standing introductory
ordinance. They did this, as long as it pleased the great head of the
church to employ them in his work. They had with them, when they
did thus practise, the promised comforter: That holy spirit who was to
assist them—to inspire them—to secure them from all error in
doctrine or discipline—to lead them into all truth: to be an infallible
guide to them. All these are facts. And all, who believe the holy
scriptures, cannot help knowing them to be facts. I appeal to them as
facts. I have proved them to be facts, in the large number of texts cited
under the last argument. With an irresistible evidence, then, doth it
appear, that water-baptism was the stated universal practice of the
Apostles. The union of the Apostles, in the practice, will be particularly
noticed and enlarged upon, under another head of proof.—Now, what
can be said against baptism by water, as an appointment of Jesus
Christ, and not a piece of superstition? Is any truth—is any duty—is
any point of christianity more substantially proved, more clearly
revealed?—So plain is this matter that it cannot, one would imagine,
be contested. However to get rid of the argument and of the ordinance,
it is said the Apostles, it is true, did practise it; but did administer it in
ignorance—as uninformed and erring men—in weakness, and
condescension to the wicked humours of their hearers:—but all along
told them it was unnecessary and unprofitable—no Gospel-ordinance
—but weak and beggarly elements—rudiments of the world—an
abrogated rite—an abolished institution—old things that must pass
away.—Strange indeed! Alas, did the Apostles practise this ordinance
in ignorance, and to gratify prejudice in their converts? They acted,
then, very wickedly. For they have herein set an example to all the
christian world, in every age, and land. For all the various communions
have followed their practice, for more than Seventeen centuries,
though differing about the modes and circumstances of it. If, then, we
be in an error, we have been led into it by Christ and his Apostles, by
following them in administering baptism as an ordinance, in his
spiritual religion. For his kingdom is not of this world, it is a spiritual
and heavenly kingdom. Are we not safer in following the Apostles, as
inspired guides, in doctrine, and worship, and ordinances, than in
listening to such as tell us they were weak and ignorant men?—But be
pleased, to consider a moment, my hearers,——Who can believe that,
under the baptism of the holy Ghost, his miraculous inspiring
influence, the Apostles would have practised water-baptism
universally, if it had not been the mind and will of Jesus Christ, that
there should be such an ordinance, in his religion?
7thly. It may tend to corroborate the proof that there is such an
ordinance to be observed in the church of God, that it was the common
received opinion, in the times of John the baptist, that the promised
Messiah, the great Saviour of Man, would practise baptism by water in
his ministry and kingdom. The people objected against John’s baptism,
because he declared that he was not the Christ, John i. 25. Why
baptizest thou, if thou be not the Christ? This question most obviously
and clearly implies that it was expected that Christ, the promised
Messiah, would have baptism by water, statedly practised, in his
kingdom or dispensation. Why baptizeth thou, if thou be not the
Christ? As many as if they had said, you take too much upon you, in
your baptizing: you assume one of the offices of the Messiah. We
expect he will have baptism, in his kingdom, as an initiation, or
introductory ordinance, representing our need of renovation.—The
Jews might be mistaken in their ideas of the expected Messiah, in this,
as in other respects.—What is now mentioned is only to show what the
common expectation was. And that common belief must have had
something to be grounded upon.—
8thly. Another consideration of no inconsiderable importance to prove,
that baptism by water, was to be a stated ordinance, in the New-
Testament-dispensation, is taken from those passages of scripture,
which do not directly, but impliedly assert, or allude to water-baptism,
as a stated ordinance or practice, in the Apostolic and primitive
Church. Titus iii. 15. Not by works of righteousness, which we have
done, but according to his mercy, he saved us by the washing of
regeneration and renewing of the holy Ghost. Paul is here guilty of a
needless repetition, or else he intends two different things, by the
washing of regeneration and renewing of the holy Ghost. By the first,
most Commentators and learned men, suppose he must intend
baptism by water as a sign of the renewing of the holy Ghost. The
original word translated washing of regeneration is the laver of
regeneration—alluding to the laver or vessel to wash in, in the Jewish
tabernacle and temple. We must be baptized, then, as well as renewed.
The Apostle here speaks, indeed, most honourably of baptism, if he
intend it, at all, as doubtless he doth.—Ephe. v. 26. That he might
sanctify it, that is, the Church, having cleansed it by the washing of
water, by the word. Christian baptism is generally supposed to be
alluded to, in this passage, as one thing implied in being cleansed, in
being regular and proper members of Christ’s Church. Romans, vi. 4.
We are buried with him by baptism. How absurd would such an
expression be, if there were no ordinance of baptism statedly
administered!—It would be unintelligible to the Christians at Rome.
What does the beloved Apostle mean? they would naturally say: We
know of no such ordinance as baptism. He must have forgotten
himself, or he would not speak of our being buried with Christ in
baptism.—We have a similar allusion to the ordinance of baptism in
Col. ii. 12. Buried with him, that is Christ, in baptism. If Christ would
have no baptism, as a stated ordinance, how improper all such
allusions to it. This scripture applies to all Christians, in all ages and
parts of the world, who have the Gospel. But what instruction doth it
contain in such allusions, if there be no ordinance of baptism?—More
texts of this kind might be easily added, but these are enough as a
specimen. If not of themselves a sufficient proof of the point before us,
still they confirm the other arguments already adduced.—
9thly. It may, with much force be added here, as a convincing and
satisfactory proof of the Institution of baptism by water, as a standing
ordinance, in the Gospel dispensation, that the Apostles were
unanimous in the administration of it, as an appointment of their Lord
and Master. They absolutely knew his mind and will. They were with
him so long, that it is impossible that they should be ignorant of his
will. When he told them to baptize, they perfectly knew what he
meant. They all practised baptism as a divine appointment. They
baptised all their converts, without one exception, that we find on
sacred record. Their command was, be baptized every one of you in
the name of Jesus Christ for the remission of Sins; and ye shall receive
the gift of the holy Ghost. These were about three thousand, being all
pricked to the heart by Peter’s Sermon, on the day of Pentecost. Now
when they heard this they were pricked in their hearts, or convinced of
Sin and savingly wrought upon, no doubt. And they said unto Peter and
the rest of the Apostles, for they were all together, the Eleven, see Chap.
ii. 1. Men and brethren, what shall we do?—Then Peter said unto them,
repent and be baptized every one of you. This is a command from all
the Apostles; for Peter spake in the name of the rest. They were all of
one opinion on the subject; and this was but a few days after they
received the commission to baptize all that should believe—go teach
all nations, baptizing them. They never differed about the necessity of
baptism. But were perfectly united in their practice. No one of them
ever made any objection to the need of the ordinance, because Christ’s
Religion was a spiritual Religion. Nay, they positively commanded their
converts to receive the ordinance. Acts x. 48. And he commanded them
to be baptized in the name of the Lord Jesus, using, beyond all
reasonable doubt, the very form of words prescribed in the original
institution. Here were both Jews and Gentiles, and one as well as the
other, were commanded to be baptized. Now is it possible for any
candid person, exercising his reason and reflecting powers, and not
determined to support, at all events, a pre-conceived opinion, to
suppose all the Apostles, in all parts of the world, among Jews and
Gentiles, in all the Churches gathered by them, would unitedly,
without one scruple, or one objector or objection, go into the practice
of baptizing with water, if not an institution of their Lord, designed to
be perpetuated, in his Gospel-kingdom, to the end of the world?—The
Gentile converts, who were thousands of miles from Jerusalem and
Judea, and where there were no Jews, were baptized, as well as Jewish
converts. There could be no reason drawn from condescension or
indulgence to prejudices, in their case, whatever there might be, in the
case of Jewish converts.—
The arguments in support of the divine rite of baptism, as a Gospel-
ordinance, would admit of much more illustration and enlargement—
but I pursue the point no further, trusting that the attentive and
reflecting hearer hath received full and entire satisfaction from the
proofs already offered.
After contemplating the scripture-proofs of the ordinance of baptism,
as a standing ordinance in the religion of Jesus Christ, it may not be a
mere waste of time, to consider, in a concise manner, what hath been
objected against it. Plainly as it is instituted, it has nevertheless
been denied.—This, together with the Lord’s Supper, hath been classed
with the old abrogated Jewish rites and ceremonies, and exploded with
them as wholly unworthy the regards of christians, and disgraceful to
the spiritual nature of Christ’s religion. The texts of scripture, which
inform us of the abolition of Jewish rites—meats and drinks—or carnal
ordinances, have been applied to the Gospel-ordinances. The
argument is this, the Apostles tell us no Jewish ordinances are binding
on us, but are all abrogated, therefore there are no christian ordinances
binding on us. This all must see, who can exercise any reason, is no
argument at all. And no man who uses it, can believe it to be any
argument. The passages of scripture which declare the abolition of the
Jewish ordinances are Col. ii. 14, to the 23 verse—Rom. xiv. 1, to the 17
verse. And in several other places the same thing is affirmed. These
places refer only to the Jewish rites and ordinances, and the abolition
of them. Any one may see this, who will attend to them. To apply them
to the christian ordinance of baptism and the Lord’s Supper, is not only
unfair and unjust, but a horrible perversion of scripture. It cannot be
done ignorantly; for any one who can read, and who is capable of
perverting such passages, must know better.——
Again:—The abuses of the ordinance of baptism, and the disputes
about it, are alledged as valid objections against there being any such
ordinance to be observed in the Gospel-kingdom. We lament that it
ever hath been abused or perverted: and that there have been so many
controversies about its nature, and the subject and mode. But this is no
kind of argument against its being a divine ordinance. For can a truth—
a duty—or a doctrine of religion be named, which hath not been
denied, or perverted, or abused?——
Another objection against the holy ordinances of the New-Testament,
baptism and the Lord’s Supper, is taken from our Lord’s washing His
disciples’ feet—Paul’s circumcising Timothy—St. James directing that
the sick be anointed with oil—and the decrees of the first Apostolic
council met at Jerusalem.—These several instances of conduct are
recorded John xiii. 4—to the 12, Acts xvi. 1—to the 4—xv. 29—and
James v. 14. The objection from these things, against the two standing
sacraments or ordinances of the Gospel, baptism and the Lord’s Supper,
is very easily obviated. Our Lord’s washing the feet of his disciples is
described as an extraordinary instance of humility, and is a
representation of the cleansing efficacy of his blood soon to be shed by
wicked hands—calculated to teach us to love one another—to be meek
—ready to do any kind office when needful, though mean—and that
we should not assume any Lordship or dominion over one another’s
consciences. And at the close, he expressly tells them he had set them a
pattern of meekness and condescension, and not ordained an
institution to be observed in his church to the end of the world. There
is a material and essential difference between setting a pattern of a
virtue or giving a remarkable display of it, and solemnly appointing a
holy Ordinance. We cannot argue from the one to the other.—We are to
follow the Redeemer, in all his doctrines and ordinances, but not to
perform the same extraordinary personal actions—any more than to
imitate him in his exterior manner, air, and habit.—As to Paul’s
circumcising Timothy, there was a very plain reason for it. It was
necessary for his reception, at that time, among the Jews. The
ordinance of circumcision was not then declared to be abolished.
When the time had come, when there was to be an open declaration of
its abolition, no one of the Apostles practised it, upon their converts.
Moreover, Timothy was circumcised as born of a Jew, and not as a
christian convert. As a convert to christianity he was baptized, as of
Jewish lineage he was circumcised. And St. Paul’s example to us, in this
is, to exercise condescension, forbearance, and humility. As to the
anointing the sick in the name of the Lord, James v. 14, it was an
appointment for the miraculous cure of such, Mark vi. 13. But since
those extraordinary gifts are ceased, as being no longer necessary for
the confirmation of the Gospel, our faith in the common course of
things has no warrant for using that ceremony; much less doth what is
here said about it, give any countenance to the Papist’s Sacrament of
extreme Unction which they administer not for the recovery of the sick,
but for a pretended purgation from the sins of those that are in the very
article of death, or past hope of recovery.
As to the decrees of the famous Apostolic council met at Jerusalem,
they were adapted to the then existing case and circumstances of the
Gentile converts, and not of perpetual obligation in Christ’s kingdom,
except one article of a moral nature, abstinence from fornication. The
others are not described as binding on all Christians. There is nothing,
in the result of that council, which can possibly signify that the practice
of Christians, in all ages, should be conformed thereto. It was wholly
adapted to the then state of the Gentile Converts.——Thus it most
manifestly appears that these instances of actions above cited and
commented upon, are not binding on Christians, in the common ages
of the Church; and were never intended to be;—nor can any argument
or objection be raised from them, of the least weight or plausibility,
against the two plain, express, and positive Institutions of the
Gospel, to be observed, in all ages, to the end of the world, baptism
and the Lord’s Supper.——
We will now make some improvement of what hath been said.—And
what are the great and special uses or purposes of this Ordinance?
Some affirm that it is a vain and unprofitable ordinance. Let us enquire,
is it so then indeed? Did Jesus Christ impose on his church a rite
useless and absurd?—The profit of it, however, appears to be great
every way. But were we convinced, that he had actually appointed it, we
ought to observe it, even if we could not discern any moral uses, or
religious benefit resulting from it—trusting in his love, faithfulness,
wisdom, and goodness.—It is of great use and importance as it teaches
us, in a striking and affecting manner, our defilement and pollution by
sin, one of the foundation-doctrines of the Christian Religion. It
teaches us this more affectingly than words can do.—It is a clear and
lively emblem of the need of the renewing of the holy Ghost. Baptismal
water points out the need of a spiritual baptism—or that we must be
cleansed from sin by grace divine, and a Saviour’s atoning blood.—The
very form of words prescribed by our Lord, and always used, teach us
where all our hope, our love, our trust, our dependence for salvation
must center, in the Father, and the son, and the holy Ghost—a triune
God. Baptismal water, as a visible sign, represents our need of having
all our sins, as to their guilt, washed away by the blood of Jesus—Be
baptized every one of you, in the name of Jesus Christ, for the remission
of sins.—Baptism, as a sensible sign, signifies our obligation to
renounce sin, and to put on the temper and character of Christ—to put
away the filth of the flesh, and to put on newness of life—to renounce
the vanity and pomp of the world—and to become clean in heart and
life. And when we are baptized, or have our children baptized, we bind
ourselves to love, to live to, to obey, and serve the one true God as set
forth in his own word.—Can the ordinance, then, be useless?—Does it
answer no important ends, no moral and religious purposes?—Is it also
recognizing our engagements to be the Lord’s we and ours. And
teaches some of the greatest and most important doctrines, truths, and
duties of Religion.—Does it then, as the deniers of it affirm, keep us
from god—from christ—from the substance—from the power
of religion?—No: it brings us, in its tendency, to them. How unhappy
that any, under a christian name, should set themselves to vilify—
reproach, and deny, it!—May the scales of ignorance and prejudice fall
speedily from their eyes; and that Jesus whose ordinances they reject,
commiserate and forgive them; and not suffer them to be the means of
spreading irreligion!—
2dly. We may enquire for the improvement of this subject, who may,
according to scripture, enjoy the ordinance of baptism? The answer is,
all who confess that Jesus is the Christ—who profess to believe in his
religion—and have a desire and disposition to honour him in it,—and
live a regular, pious and religious life. Such may enjoy it for themselves,
and infant seed.——
3dly. As another observation for the improvement of the subject, we
may ask how is it to be administered? Water is to be applied to the
subject by sprinkling the face, or by immersion, in the name of the
father, son, and holy Ghost. The quantity of water is a mere
circumstance. And immersion is as valid as sprinkling.—Mere
circumstances are left to the wisdom, prudence, and convenience of
the observer. Some prefer immersion as the most scriptural, and
others, sprinkling. Both are valid. Both are right? All that is essential is
the application of water, in one of these ways, to the meet subject, as
the form is prescribed. Some admit, others exclude infants, but this
need be no bar to christian communion. Had the various
denominations of christians entertained these catholic and charitable
sentiments, there would never have been any dispute about the mode,
and much evil would have been prevented.—I hope and expect the day
will come—and O that it might not be far distant, when these
reconciling and compromising sentiments will have a general diffusion;
when all real christians will be united, though practising in different
forms, and bend their whole force and zeal against error—vice—and
irreligion.
4thly. Let all Christians feel a due and unshaken attachment to public
worship, the Sabbath—and all divine ordinances. All of them ought to
be dear to Christ’s disciples. We should esteem them. We should love
them. We should diligently and constantly attend unto them. We are,
at the same time, to take care that we do not place our hope in, or
dependence on them, instead of the God of ordinances, the Saviour’s
all-cleansing blood, and the spirit’s sanctifying operations. Means and
ordinances are the helps provided by a wise, gracious, and holy God. In
the appointment of them we see, in a most wonderful manner, his love
and grace, goodness and patience, wisdom and condescension. Let our
eye, then, be to the God of grace to bless and sanctify unto us, all
means and ordinances. By the power of the holy Ghost we are; and we
must be renewed. But we ought nevertheless to prize and esteem all
divine institutions, as means of holiness and pious instruction. We
should be grieved when any neglect them, revile them, or deny them.
For they are the ways prescribed by God, to uphold religion, in the
world, amid the floods of error, ignorance, fanaticism, and infidelity,
which threaten the existence of all serious godliness.
5thly. We hence infer the duty of all people to prepare themselves
without delay, to enjoy the ordinance of baptism. It is a precious
ordinance. It is divinely appointed to teach us, the great truths of
Religion, and to help forward our salvation. All parents should see that
they lose no time in preparing to enjoy it for themselves, if unbaptized,
and for their Children. And what, my dear friends, is required of you, is
to seek and know God:—to desire to do your duty: to honor your Maker
and Redeemer in the ways, which he has so clearly appointed.—Permit
me with all tenderness and affection as a Minister of Jesus Christ to
urge you to give no rest to yourselves, till you have rendered yourselves
meet for the enjoyment of Gospel-ordinances.—How mournful is the
idea that so many, in our Land, live in the total neglect of this holy
sacrament of baptism.—Unbaptized Children! Unbaptized Parents!
Unbaptized Youth!—How affecting the thought to all the lovers of
Gospel-ordinances.—What impiety prevails!—what neglect of religion
in general—of prayer in families in particular, and of public worship.—
Will not a holy and righteous God visit for these things?—Many boast
of this, as the age of reason—of our land, as the land of reason—and
talk of the complete downfall of superstition, and bless themselves, at
the thought of the diffusion of sceptical principles, and are as zealous
to propagate irreligion, error, and infidelity, as if the salvation of our
country, their own salvation, and the salvation of others depended on
the abolition of christianity, against which the most virulent attacks are
made, under the name of superstition, or a sectarian religion.—
But some seriously inclined people are objecting, perhaps, and saying
we wish to enjoy divine ordinances, but you have made the way too
strict, more so, than God has made it, in his holy word.—Consider a
moment, before you draw up a conclusion so unfounded, and so much
to your disadvantage. All that is required of you, is to give yourselves up
to God and the duties of Religion.—Can less be required? Can any
lower terms be rationally desired? We must never profane an
ordinance, or prostitute and abuse it to worldly designs and ends.—
Often, alas! have this, and the ordinance of the Lord’s supper been
perverted and profaned; and so have the holy Oracles of God, which
are the only Oracles of reason, and of eternal truth, and of all religion.
Let us see that we are not among the number of those, who profane
and abuse, or neglect and forsake it.—Come, then, and take the vows
of the Lord upon you, and give yourselves up to the duties of our holy
Religion, and enjoy all its ordinances and special privileges.—Defer not
—procrastinate no longer the concerns of your souls and of Salvation.
—Behold now is the accepted time! Behold now is the day of Salvation!
To-day, if ye will hear his voice. There may be no to-morrow for you—
no more time—no more seasons of grace. A small space of time will
end all your days, and open to us an everlasting state.—Hear, then, the
call of God, of reason, of virtue, and of Religion. Delay:—O! delay no
longer. Come and take Christ’s yoke upon you, and learn of him, for he
is meek and lowly in heart, and ye shall have rest unto your souls.
6thly. For what hath been said, let all who have enjoyed the ordinance
of baptism, feel the sacred bonds thereof, and seek divine grace to
enable them to live up to their baptismal vows. Let parents who have
come forward and had baptism for their Children, and have devoted
them, therein, to God, to be his, and for him, bring them up in the
ways of Religion—teach them to pray—and pray with, and for them in
their houses:—instruct and govern them for God—set a pious example
before them—and teach them their baptismal dedication—the
meaning and import of it, as above explained, and as a peculiar
privilege binding them to be the Lord’s.—And let such parents, farther
examine their own hearts and ways, and see if they gave up their
Children, in the baptismal dedication, in outward appearance only, or
in sincerity and in truth, hoping and trusting in God’s mercy and truth
for them.—And let parents who never prepared themselves to bring
their Children to God, in baptism, when they look on their dear infant
flock, feel a deep sense of their sin, in the neglect of their duty to them:
and so pity, and so love them, as to come forward, and give them up to
God in baptism.—And Let unbaptized youth realize their duty, and
never give themselves rest, till they have dedicated themselves to God,
in his covenant and baptismal institution, to be his in life, his in death,
and his forever.——And let the whole Congregation that now hear me,
old and young, esteem, rightly improve, and highly value all the
institutions of the Christian Religion; endeavour, by all the light and
advantages, which you enjoy, truly to understand them:—to place
them on their proper foundation; and to look to the God of all grace,
for his powerful, purifying, and all-cleansing influence, and to Jesus
Christ that the guilt of sin may be washed away:—and make it your
grand concern to walk in all the commandments and ordinances of the
Lord, blameless.

D I S CO U R S E XI.

It is the will of the Author of Christianity that, in the


New-Testament dispensation, there should be particular
Gospel-Churches.
1 . T H E S S A L O N I A N S i. 1.
Paul, and Silvanus, and Timotheus, unto the Church of
the Thessalonians, which is in God the Father, and in the
Lord Jesus Christ: grace be unto you, and peace from God
our Father, and the Lord Jesus Christ.
Thessalonica was the Metropolis of that part of antient Greece, now
Turkey in Europe, called Macedonia. It was built by Philip of Macedon,
Father to Alexander the great, so famous in history, and called
Thessalonica, in honor of his victory over the Thessalians. In this
renowned City, Paul preached a considerable time, and was greatly
successful in spreading among its inhabitants, the truths and glory of
the Gospel. From the Jews and proselytes to their faith, and the
idolatrous heathen or Gentiles, he collected a Christian Church. The
people of this large city were principally heathen, who worshipped
them which are by nature no Gods.
This Epistle to these Christians gathered into a Church-state by the
labours of St. Paul, assisted in the arduous and important work by Silas
and Timothy, was the first Letter, we are told in ecclesiastical history,
which he ever wrote as an inspired penman to any of the Churches.
And he begins it, in a very modest manner, with the words of our text,
which may be thus paraphrased——“Paul, together with Silas and
Timothy, his assistants in the work of the Lord at Thessalonica, send
greeting to the Church of Christ, which has lately been planted by
means of our Ministry, and ordinarily assembles for religious worship
and discipline at that renowned Metropolis of Macedonia, and consists
of believers in God the Father, in distinction from the idolatrous
Gentiles, and of believers in the Lord Jesus Christ as the only true
Messiah, in distinction from the unbelieving Jews, who denied him:
and so we regard you as persons that are in union, and have fellowship
with the Father, and with his Son Jesus Christ.—May all the riches of
divine love and favour which is the fountain of every blessing; and as
the fruit of this, may all manner of prosperity inclusive of every
desirable sort of peace with God and others, and in your souls, be
multiplied to all and every one of you, according to the scheme of
salvation from God our Father, and from the Lord Jesus Christ as the
only Mediator and peace-maker, who has purchased all blessings for us
by his blood; and freely communicates them to us by his spirit in an
inseparable concurrence with the Father.” The salutation of the
inspired writers, in their Letters to the various Churches, are
exceedingly tender and affectionate. They wish them every blessing:
that the peace of God may be with them: that the mercy of God may
abound towards them: that the peace of God may dwell with them. The
Apostles in all their Epistles appear most friendly and cordial; anxious
to guard the Churches from error—to warn them of heresy, unsound
doctrine, and false Teachers. They lay before the Converts to
Christianity, the subtlety, the arts, the divisive efforts of impostors. And
the need of such things is experienced in every age of the Church.
Deceivers and scoffers, more or less, every where, abounded since the
days of the Apostles. And by them, the glorious cause of the Gospel
and of the Redeemer has been greatly injured.—This Christian
affection, displayed in the salutations of the Apostles to the Churches,
does great honor to them as men, and as Christians; it shews, at the
same time, the amiable and pleasing temper of the Christian Religion.
It is a religion of benevolence and kindness. It is a religion of goodness
and philanthropy. One of the most surprising objections against it,
ever made, is that it is defective in point of friendship. This is the last
thing that ever I should suspect would be spoken against it. Such as
thus object, it is to be feared, are totally unacquainted with its nature.
—For every one, who possesses the temper of the Gospel, not only
loves God with all his heart, but his neighbour as himself—is willing to
do, as he would be done by—and wishes the good of all.—His wish for
others, is like that of Paul to the Thessalonian Church, grace be unto
you, and peace from God our Father, and the Lord Jesus Christ.
After thus introducing the words of the text, what is proposed, is to
state the scripture-evidence in favour of the institution of a Gospel-
Church.—What is before us, is to prove that it is the will of the author
of Christianity that, in the New Testament dispensation, there should
be particular Gospel Churches.
In order to do this subject justice, it will be necessary briefly to explain
and illustrate the nature of a Gospel Church—the ends of its
institution—the terms of admission into it—and the duties
particularly incumbent on its members.—To enter largely upon these
several points would require, even each one, a volume. Christians have
thought very differently concerning them. And learned divines have
disputed much about them.—I shall confine myself to what will be
conceded by all parties to be important and necessary. The great and
essential things are those, which should principally be regarded and
attended to by all. When we descend into what is very minute and
critical, the ingenious and the learned will take different paths. And
very often, things, in their nature, minute or abstruse, occasion angry
controversy; and call forth as much warmth as the essential truths or
duties of Christianity. It is well known, and generally observed, that the
Church of God is either invisible or visible. The former is composed of
all who are, have been, or shall be the people of God in truth and
reality, in whatever age they may live, or whatever Country they may
dwell, or to whatever Communion they may belong. The latter, or
visible Church of God is composed of such as openly profess the
Christian Religion, attend its divine ordinances—have received
baptism—and have devoted themselves, in some open manner, to the
Redeemer. Persons may lose their membership in the visible Church,
by denying revealed Religion, or by embracing errors fundamentally
wrong, or by open and gross immoralities. The general visible Church
is made up of all the particular Churches of the various denominations
which hold to the foundation. Particular Churches are societies of
professing Christians, who have formed themselves into one body, in
different ages, places and Countries, for mutual edification, in the joint
public worship of God, and the celebration of Gospel ordinances. Thus
the professing Christians in Corinth—those in Thessalonica, those in
Ephesus, and those at Colossae are called a Church. These however
made but one Church in reality. For they received the same Gospel,
maintained the same form of worship, and professed subjection to the
same common Lord. The Church universal comprehends all the
particular and local Churches. That there should be distinct, separate,
or local Churches, is evident from this consideration, the convenience
of attending public worship, of exercising discipline, and enjoying
special ordinances. Different forms of doing this have been adopted, in
different ages and Countries. Some are attached to one form, and some
to another, according to education, or habits of thinking. And the
administrations or different forms will be allowed to be good, or valid
by all who are not under the influence of bigotry. Catholic and candid
Christians of various denominations will embrace each other, in the
arms of Christian or fraternal affection and Charity; while the narrow-
minded and bigoted of every communion withhold Charity from all,
who are out of the pale of their Church. To confine salvation to one
form only and exclusively is the mark of a bigoted mind. The Scripture
hath no where laid down the precise form of Church-order and
government. It hath left, the particular and precise form to be
practised upon, to the convenience, wisdom, and prudence of
Christians; or to their peculiar circumstances. One particular form may
have its advantages and disadvantages. That is the most eligible which
hath the fewest inconveniences, and most excellencies. Such only are
essentially wrong as plainly contradict the word of God, and introduce
tyranny and domination into the Church of God. Lording it over God’s
heritage is always a crime of a malignant nature. Ecclesiastical tyranny
is as much to be dreaded as civil. There must, with regard to local and
particular Churches, be distinct places of worship, and jurisdictions.
They may, however, be considered as one in doctrine, in discipline, in
love; calling on the name of the same Jesus, their common Saviour and
Lord, receiving for substance the same articles of faith, and attending
on the same ordinances. A Church, in the original meaning of the
word, is an assembling together of a number of persons, for particular
purposes; especially religious ones, that they may jointly engage in
divine worship, mutually edify one another, and attend all divine
ordinances, agreeably to the word of God, taking that for the only rule
of their faith and practice. And a number covenanting together to walk
by this rule, to conform to all the revealed will of God, and to watch
over one another, and to exercise the discipline of the Gospel, is the
sense, in which the word Church is used, in scripture, when it is taken
for a particular Church. The word indeed is used in the several senses,
which have now been mentioned.
The design of the supreme being in the institution of a Gospel Church
is, in general, the mutual edification of the members, the interest and
honour of religion, the divine glory, and man’s Salvation. A gracious
God has wise intentions in all he does, whether in the world of nature,
or administrations of providence, or redemption of the Gospel. He
doth nothing in vain. In the things of Religion the divine wisdom and
goodness appear in a most pleasing and attractive light. And his
design, in the institution of a Gospel-Church, was that mankind might
be under the best advantages, to honour his great name, and secure
their own Salvation; that the interests of piety and Virtue might be best
consulted and promoted. A regular or duly organized Church is
composed of the church-officers and private brethren. The officers in
Christ’s kingdom are of two kinds or ranks, Pastors and Deacons. And
the Pastors are called indifferently Elders, Teachers, Ministers, Bishops,
and Overseers of the Church. As Christ’s kingdom is not of this world,
so no considerations of a worldly nature are the Scripture-motives for
our professing ourselves to be members of it. The design which we
ought to have in view in belonging to it, should be altogether spiritual;
that we may, in the enjoyment of proper means, be built up in
knowledge and holiness; that we may be made meet for the inheritance
of the saints in light; may publicly worship the Deity, attend divine
Ordinances, celebrate together the divine praises, on the holy Sabbath,
and watch over one another; that we may all at last be convened
together in heaven, to join in all the purity, sublimity, and perfection of
celestial worship: and be prepared in the temper of our minds to
celebrate forever, the high praises of our Creator and Redeemer, in the
Church triumphant.
Among the members of a Gospel-Church there is always supposed a
solemn covenant or agreement to walk together in the laws, doctrines,
truths and ordinances of Christ, to exercise the discipline of the head
of the Church in meekness and love, and to aid one another in the way
to eternal blessedness.
What is required of us in order to be received, as regular members, into
a Gospel-Church, is that we have some general knowledge of the great
and essential doctrines of the Gospel; that we declare our belief in
them; our subjection to Christ as our Lord; and that our conduct and
conversation have been agreeable to the Gospel, or if otherwise, that
we profess sorrow and reformation. Much hath been said and written
about the qualifications necessary to an orderly and acceptable
attendance on the special ordinances of the Gospel. Good men have
differed widely from each other, in their opinions, concerning a point
which, all will allow, is very important. But in too many instances, this
difference has occasioned bitterness, and hard judging. If we lay aside
prejudice, and attachment to names and parties; and impartially look
for direction and guidance from the holy scriptures, it might be
expected that there would be a greater union. The scripture is plain.
And the very reason and nature of the thing teach us what is required,
in order to participate of Gospel-Ordinances to divine acceptance, and
our own edification and comfort. The nature of the ordinances, and of
a Gospel Church may lead us to form some just opinion of what is
necessary as a term of admission into the latter, and enjoyment of the
former. All Christians who love our Lord Jesus Christ in sincerity, if
they impartially consult the advancement of his cause, would wish to
have any difference which may subsist among them, lessened, and
their union strengthened. Their endeavour should be to keep the unity
of the spirit in the bond of peace. The more Christians differ, the more
occasion is given to the enemies of the cross of Christ to triumph. The
very attempt to promote peace and union merits the approbation of all
Zion’s friends. There is but one Salvation—and one way to obtain it.
There is one body, and one spirit, even as ye are called, says the Apostle
to the Ephesian Converts, in one hope of your calling; One Lord, one
faith, one baptism—one God and father of all who is above all, and
through all, and in you all. Must it not be evident, then, that all who
would enjoy the particular ordinances and privileges of this one Lord
and his religion, should have some general knowledge of the doctrines,
truths, and duties of this religion? If grossly ignorant of these, how can
they honor the Redeemer, or rightly and profitably attend his holy
institutions? And is it not also clear, that they must believe in this
religion; and openly profess their belief, in some way, which shall be
satisfactory; and feel a regard and love to it? Must they not be
impressed with such a sense of its importance as to be resolved, to live
agreeably to its precepts, that they may enjoy its consolations, and be
entitled to its rewards? And if their former lives have been openly
immoral and profane, or scandalous, is it not indispensably necessary,
that they profess repentance? All who are doctrinally taught, morally
clean, and piously disposed, may acceptably attend on the special
ordinances of the Christian Religion. If we examine the conduct of the
Apostles, our infallible guides, in discipline as well as doctrines, we
shall see that they required of all, whom they admitted into the
Churches gathered and formed by them, a confession that Jesus was
the Christ, and a solemn purpose to conform themselves to the
precepts of his Gospel, and to depend on him for salvation.—
After just hinting at the terms of admission into the Gospel-Church,
the duty of the members may with propriety be stated in a few words.
This is of large extent. In general, it is to walk in all good conscience
before God. And in particular, they should set a pious example to
others, by a steady and unshaken attendance on public worship—on
means and ordinances. They should show to the world, their high
esteem of them, as appointed by infinite wisdom and goodness. And if
in any place or among any people, where their lot may be cast, at any
time, divine ordinances should be vilified or disowned, they should
more especially show their esteem of, and attachment to them. To
study the peace, the prosperity, and welfare of the Church; to watch
over one another in meekness and love; to do all in their power to
prevent errors; to heal divisions, if any arise; to avoid giving just
grounds of offence to any; to keep from all party views and aims; and to
honor God, in all his ways, is incumbent on all members of Churches.
The solemn covenant and promises, which they take upon them, either
expressly or virtually, bind them to particular duties. The vows of the
Lord are upon them. And covenant-breakers—and promise-breakers
are among the most odious characters. For we never know when or
where to trust such. The character of a citizen of Zion is, that he that
walketh uprightly and worketh righteousness, and speaketh the truth in
his heart—and he that sweareth to his own hurt, and changeth not. The
man who deliberately breaks his religious vows and covenant
engagements, can have no sense of God or divine things. His heart
must be obdurate, and his conscience asleep.—All, who have named
the name of Christ, should be careful to depart from iniquity, and see
that their conversation is such as becometh the Gospel. Such, in brief,
is the duty of all the members of a Gospel-Church.
The way is now prepared to exhibit the scripture-evidence that it is the
will of the author of Christianity, that in the New Testament-
dispensation, there should be particular Gospel-Churches. The proof
of this from the word of God, is plain and full. It is apprehended that, if
we admit the divine authority of the scriptures, we shall be obliged to
admit the reality of Gospel-Churches.——For—in the first place, Jesus
Christ, in so many words, declares that he has a Church, which is
sometimes called his kingdom—his flock—his followers—his people,
—and those whom the Father gave him, or his sheep. When Peter
made that noble confession in answer to his Saviour’s question, Thou
art Christ, the son of the living God. The Saviour replies; And I say unto
thee thou art Peter, and upon this rock I will build my Church, and the
gates of hell shall not prevail against it. Allusion is here made to the
meaning of the word Peter,—his person—or successors in office, was
not the rock, upon which the Church was to be built; but the
confession that he made, that Jesus was the Christ, was the rock, upon
which the Church was to be built. And to the joy of all true friends to
the Gospel, no power of evil men, or evil angels, however, much they
may be permitted to vex, persecute, and distress, shall be able to
overthrow the Church. It will live amidst all winds that may blow. It
will be supported in the midst of all storms, or dangers. No weapon
formed against it shall eventually prosper. It will continue, through all
time, and finally prevail. Surely there is no inchantment against Jacob,
neither is there any divination against Israel. The words of Balaam
spoken of Israel, may be pertinently applied to the Church of our Lord
Jesus Christ, How goodly are thy tents, O Jacob, and thy tabernacles, O
Israel! Saul is said to make havock of the Church. As for Saul he made
havock of the Church, entering into every house, and haling men and
women, committed them to prison. These men and women, who fell as
victims to his persecuting rage, were members of the Church. But how
could he make havock of the Church, if there were no such thing as
Gospel-Churches? Herod is said to stretch out his hand to vex the
Church. Now about that time, Herod the king stretched forth his hands
to vex certain of the Church. The unhappy individuals, whom he sorely
persecuted, were members of the Gospel-Churches, organized by the
inspired Apostles,—The Church at Jerusalem received some that were
sent to them, upon special business, with friendly affection. And when
they were come to Jerusalem, they were received of the Church. This
must be the Church that was planted in that City, of which St. James
was the stated Bishop, and whom Herod cruelly put to death. And the
Church is said to be purchased by the blood of Christ. Take heed
therefore unto yourselves and to all the flock over which the holy Ghost
has made you overseers to feed the Church of God, which he hath
purchased with his own blood. Christ is represented also as head over
all things to the Church; and it is by an easy metaphor called his body.
And hath put all things under his feet, and gave him to be head over all
things to the Church, which is his body, the fulness of him that filleth all
things. He is said to love the Church—to give himself for it—to sanctify
and cleanse it. Even as Christ also loved the Church, and gave himself
for it, that he might sanctify it and cleanse it with the washing of water
by the word, that he might present it to himself a glorious Church not
having spot, or wrinkle, or any such thing, but that it should be holy and
without blemish. Again, observes the Apostle Paul, This is a great
Mystery, but I speak concerning Christ and his Church. All particular
Gospel-Churches make one universal Church. Where the same
essential doctrines are maintained—the same common Saviour owned
—the same ordinances celebrated—though there may be many
circumstantial differences, as to names, opinions, and forms, it is the
same Church.—If there be not a Gospel-Church, in which the word
and ordinances are to be dispensed, prayers offered, and the Sabbath
observed, why is there this frequent mention of the Church? a
multitude of other passages, which speak of the Church or particular
Churches, might be easily cited, but those already cited are sufficient,
as a sample. Did our Lord and his Apostles know what they said; or did
they mean to mislead and impose upon us? If they know what they
said, and meant faithfully to teach us, then the institution of a Gospel-
Church cannot be denied.
In the next place, when the Apostles went forth and preached the
Gospel to all nations, the Lord working with them and confirming the
word with signs following, they gathered and formed churches,
ordained pastors, and chose deacons. In Judea, in Galilee, and in
Samaria were churches formed, teachers set over them, and other
necessary regulations made, before Paul’s conversion, while he, by the
fury of persecution, endeavoured to destroy the christian cause. For we
are informed of the rest and peace which the churches, in those
countries, enjoyed after his conversion to christianity. Then had the
churches rest throughout all Judea, and Galilee, and Samaria and were
edified. In those places, churches were collected, in which public
worship and divine ordinances were celebrated. In Galatia, Ephesus,
Smyrna, Thyatira, Philadelphia, Laodicea, Thessalonica, Philippi,
Rome, and Jerusalem: and to name no more particular places, in Asia,
Africa, and Europe, that is, in a great part of the then known world,
were churches gathered and christian Ministers set over them, by the
Apostles. This we are as certain of, as we can be of any thing recorded
in holy Writ. We find it, in the history of the acts of the Apostles, and
in their Epistles. We cannot doubt or hesitate about this matter,
whether it be fact or not. The Apostles wrote, sent, and dedicated their
Epistles to particular churches. For instance, inspired letters are
directed to the church at Rome, Corinth, Galatia, Ephesus, Philippi,
Thessalonica, and Colossae. But why is this done, if there were no
churches formed in any of these places? Did the Apostles dedicate long
Epistles to what did not exist? Did Paul write to the church, at
Thessalonica, as my text says he did, when at the same time, there was
no church there?——If we ask, what was the business of these
churches; the answer is, to attend upon the preached word, and
dispensed ordinances. By public worship they were to honour God, to
promote religion, to preserve pure and entire all divine appointments,
and to build up one another in faith, love and good works.—
In the third place, the institution of divine ordinances, the christian
Sabbath, public worship, and the christian Ministry, is an argument in
favour of the institution of Gospel-churches, which cannot fail deeply
to impress conviction upon the mind. We have full and very plain proof
of the institution of divine ordinances, baptism and the Lord’s Supper,
of public worship, of the christian Sabbath, and of the office and work
of a Gospel-Minister. The conclusion is there are particular Gospel-
churches. There is no possible way to get rid of this conclusion, but to
deny the premises. Both are true, or both are false. If we reject the one,
the other cannot be maintained. In order to be self-consistent and
uniform, if we deny the institution of a Gospel-Church, we are under a
necessity of denying all divine ordinances, and rejecting the idea of a
Gospel-Ministry. One error, like one falsehood, draws after it another:
it leads to a second—to a third, to support itself. He who denies one
part of the Gospel, is at length compelled to retract his error, or to give
up another part. If we deny the institution of the Christian Sabbath, we
are obliged to deny, in order to keep ourselves in countenance, by the
appearance of consistency, stated public worship and divine
ordinances. And if we deny these, we must reject all idea of particular
Gospel-Churches. For the very notion of a Gospel-Church is a number
of professed believers in Christ, formed into a union and fellowship, by
a solemn covenant, to enjoy religious worship, and Gospel-ordinances.
In the fourth place, it seems that a denial of the institution of particular
Gospel churches, in which the discipline of the Gospel is to be
exercised, as well as its worship and ordinances observed, involves in it
the denial of the whole Gospel. The Apostles certainly tell us of their
planting churches—of overseers placed over those churches, to labour
among them in word and doctrine—to reprove, to exhort—and to feed
them. They tell us of the discipline to be exercised in Christ’s house;
how church-officers are to conduct, in the discharge of their offices,
how the church is to be ruled and governed—how ordinances are to be
dispensed—how deacons are to serve the table of the Lord—how
private brethren are to demean themselves. They largely describe the
character and duty of Ministers—and the duty of the members of a
church in a church-capacity. But how are we to understand all this? If
there be no Gospel-churches in the New-Testament-dispensation, what
are we to believe—what are we to admit—and how shall we acquit the
Apostles of dishonesty and ignorance? The whole Gospel, therefore,
must stand or fall with the idea of particular Gospel-churches,
instituted by the labours of the Apostles, under the authority and
inspiring influence of the holy Ghost. If the formation of them be a
human device, man’s work and contrivance, then we can rely on
nothing, which the Apostles either taught or did.
In the review of this subject, we see the necessity of keeping most
exactly to the holy scriptures, in the discipline and order of our
churches, in the forms of external administrations, as well as the
doctrines and duties, ordinances and practice. Our articles of faith, and
our rules of life are to be taken wholly from them. The direction to
Moses, that distinguished servant of the Lord, in respect to the
building of the Tabernacle, See that thou do it according to the pattern
shewed thee in the Mount, should lie, with all its weight and
importance, upon the minds of all the builders in Christ’s spiritual
kingdom. We should anxiously aim at the original primitive simplicity
of the Gospel, in our mode of worship, in our discipline, in our terms of
admission into the church, and in our doctrines. A medium between
fanatics and formalists seems to be nearest the faith and order of
Gospel-Churches. Mankind are so prone to extremes, in things of
Religion, as well as other things, that a medium is usually the nearest
to what is right. Fanatics are for refining and reforming away all order,
and truth. Formalists place all religion in things exterior. This hath ever
been the case, from the day of Christ, down to the present age, as
appears from the history of the Church. Both fanatics and mere
formalists are wrong. But which are most culpably criminal and
erroneous is hard to determine. For in Christ Jesus, neither
circumcision availeth any thing nor uncircumcision, but a new creature.
He is not a Jew which is one outwardly, neither is that circumcision
which is outward in the flesh. And unless our righteousness shall exceed
the righteousness of the Scribes and Pharisees, we shall in no case enter
into the kingdom of heaven.—Upon the whole, let us all be persuaded
that true Religion is the way of duty: and that the way of duty, is the
way of happiness.

D I S CO U R S E XII.

The right way to understand the inspired writings.


L U K E xxiv. 45.
Then opened he their understanding, that they might
understand the scriptures.
The design of the scriptures is to make us wise unto salvation. They
contain all that is requisite as a rule of life or standard of faith. They
instruct us what to believe concerning our Maker, our Redeemer, and a
future State. They place before us all that is necessary to be believed,
and to be done, in order to be accepted of God, and entitled to life
eternal. Those, therefore, who really desire salvation, will feel it to be a
duty of very great importance to study, as accurately as they are able,
and to read diligently, the inspired writings. A frequent, daily, and
serious reading them is incumbent upon us all. He that is of God,
heareth God’s words, ye therefore hear them not, because ye are not of
God, said our Lord to the unbelieving Jews. And he directs us thus,
search the scriptures, for in them ye think ye have eternal life, and they
are they which testify of me. If people refuse to search them, or to read
them with care, frequency, and a serious endeavour to understand
them, how is it to be expected, that they can know the character of the
Saviour, or their duty.—The inhabitants of Berea are commended for
their care in searching the scriptures. These were more noble than those
in Thessalonica, in that they received the word with all readiness of
mind, and searched the scriptures daily whether those things were so.—
It is a noble duty—a rational, and commendable duty to study, and
daily peruse them, that we may know the truth, and be excited to
practise it.—And the best way to gain entire and full satisfaction, with
respect to the divinity of them, or whether they be, what they pretend
to be, divinely inspired, is carefully and critically to read them. As
the most satisfactory way to be convinced whether there be a God, is to
open our eyes on his works! so the most satisfactory method to know
whether the holy scriptures be from God is to read them, with
seriousness and diligence, and with a candid and unprejudiced mind.
He who will read them, in this manner, and practice according to their
precepts; and sees their tendency and aim, which most apparently is to
glorify God and save man, cannot long retain any scruples about their
celestial origin.—If any man will do his will, he shall know of the
doctrine, whether it be of God, or whether I speak of myself.
The pains we are to take to read and understand the scriptures may be
seen, in a beautiful manner, in the following words: And these words
which I command thee this day, shall be in thine heart. And thou shalt
teach them diligently unto thy Children, and shall talk of them, when
thou sittest in thine house, and when thou walkest by the way, and when
thou liest down, and when thou risest up. And thou shalt bind them as
frontlets between thine eyes. And thou shalt write them upon the posts
of thy house, and on thy gates. The advantages of heedfully and
seriously reading and studying the word of God are many and great. It
will make us knowing and wise, in things heavenly and divine. It will
tend to render us pious and devout. It will lead us to God and duty. It
will be a safeguard against error and infidelity, against superstition and
enthusiasm.——
Considerations of this nature render the subject, proposed now to be
discussed, peculiarly important and interesting. The subject is the
right way to understand the inspirited writings.—Then opened he
their understanding, that they might understand the Scriptures. The
occasion of these words is this;—Jesus had risen from the dead, and
took the most prudent and eligible method to convince his disciples
and friends of the fact, upon which rests the truth of his religion. Two
of them, Cleopas and another, were going to a village, called Emmaus,
about threescore furlongs distant from Jerusalem. On their way, they
conversed about the strange things, which had happened—the
crucifixion of the expected Messiah, and his wonderful resurrection on
the third day.—Jesus joined himself to them, as a stranger, in the midst
of their interesting conversation. He enquired what the subject was,
upon which they were conversing; and upon which they seemed so
anxious and deeply engaged. They informed him. And Cleopas
expressed much surprise, at his enquiry. Art thou only a stranger in
Jerusalem, and hast not known the things which are come to pass there
in these days?—Upon hearing the subject of their conversation—and
which indeed was the general topic at that time, in all the city, he took
the lead in it.—And the disciples were all attention—they were all ear
—and their hearts burned within them, with a heavenly flame, while
the appearing stranger, though in reality their risen Lord, discoursed
on the pleasing theme, and expounded to them the scriptures, which
related to himself. They were delighted. They were improved. Light
broke in upon their understandings, and devout affections were
inkindled. Then said he unto them O fools and slow of heart to believe
all that the prophets have spoken. Ought not Christ to have suffered
these things; and to enter into his glory? And beginning at Moses, and
all the prophets, he expounded unto them in all the scriptures the things
concerning himself.—He, then, discovered himself unto them. They
could hardly believe, what their eyes had seen and ears heard, for joy.
He again showed himself to his chosen witnesses, and expounded to
them also, the word of God, as in the verse next above the text, And he
said unto them, these are the words which I spake unto you, while I was
yet with you, that all things must be fulfilled which were written in the
law of Moses, and in the prophets, and in the Psalms concerning me.
——Then he opened their understanding, that they might understand
the scriptures. Saying thus it is written, and thus it behoved Christ to
suffer, and to rise from the dead on the third day. And that repentance
and remission of Sins should be preached in his name, among all
nations, beginning at Jerusalem.
How did he open their understanding, that they might understand the
scriptures? It was by a just and true expounding them as well as deeply
impressing their hearts. He laid their real and true meaning before
their minds. He showed them the connexion, and reference to himself.
And they understood him, and plainly saw the meaning, design, and
intention of the Sacred writings. He gave them no new faculties and
powers. He directed them how to use and employ their reason rightly
to apprehend, and duly to apply scripture. We are, consequently, to
exercise our rational powers in seeking the meaning and design of
divine revelation.——Christ opens our understanding to understand
the oracles of God, by using with us the proper means of information
and instruction, and by saving influences on the soul. We are rational
beings. And he treats us as such, not as machines, or beings that had
no reason or conscience. He opens the understanding, by enabling us,
in the exercise of reason, and our reflecting powers and capacities, to
study into, and seek the meaning of holy Writ—to search into the
meaning of the words used, and the order and connexion of them; and
to divest ourselves of all corrupt biases and prepossessions. By reason
of sin, or through the depravity of the heart, the mind is blinded to the
spiritual beauty and glory of divine objects.——The purpose of the
present discourse, is to point out the right way to gain a true and just
understanding of the holy scriptures.
And in general, it must be allowed, that they are capable of being
rightly understood. If the Supreme Being, in his infinite wisdom and
goodness, be pleased to grant us a revelation of his will at all, he would
give us such an one, as, with honest and upright intentions, could be
easily understood, in its great and essential principles and duties,
ordinances and doctrines. For to give us one that was involved in
mystery, and could not be comprehended after a diligent, painful and
careful examination, could answer no valuable purpose; nay, it would
be altogether improper. It would, in truth, be to insult our misery. The
language of it would be this. “Here is poor fallen man, blinded with
prejudices—carried away with evil passions—plunged in the ruinous
effects of the Apostacy—unable by the mere light of unassisted reason
to find the path of duty and happiness. He is in perishing need,
consequently, of a safer guide, an infallible directory, in the way to
glory. Behold I will provide a Saviour for the helpless: a sanctifier for
the unholy: I will grant him a revelation of my will.——But such an one
as cannot be understood by him, even when he hath used most
sedulously all possible pains and care, and means to understand it.
Such an one as is insufficient to answer the intended purposes.” To
urge, then, that the revelation, which we enjoy, of the divine will and
our duty, cannot be truly and really understood, in all its essential
principles, when no exertions or honest endeavours and faithful care,
on our part, have been wanting, is to reproach the wisdom and
goodness, grace, and justice of God: nay, it is to blaspheme his name:
to represent him as trifling with his creatures; and mocking them in
their misery. Far be such folly and impiety from us! We do therefore
plead, and strenuously insist, that all things necessary to salvation, are
laid before us, with sufficient clearness, both in regard to doctrines and
practice, both what we are to believe, and what we are to do. The design
of all the inspired writings is to save fallen man—to teach him that he
may be pardoned and accepted of his sovereign Lord and Maker—to
open the method, in which pardon here, and happiness hereafter have
been procured—and the terms upon which they will be granted. As
these things are of infinite importance to all, high or low, learned or
unlearned, so they are revealed with as much plainness as possible.
What the Psalmist says of the divine law, may with equal truth be
applied to the Gospel. The law of the Lord is perfect converting the soul:
The testimony of the Lord is sure, making wise the simple: the
commandment of the Lord is pure enlightening the eyes.
St. Paul takes it for granted, that the principal and fundamental points
of christianity, which he calls the first principles of the oracles of God,
are easy for all to comprehend and to learn. And when for the time ye
ought to be teachers; ye have need that one teach you again which be
the first principles of the oracles of God. There are certain doctrines and
duties of the Gospel, which are essential to the very existence of all
religion, and which may, with the utmost propriety, be called the first
principles of the oracles of God; upon which all the rest are built, and
to which they constantly refer. These are plainly expressed, often
illustrated, and warmly inculcated. None can mistake them, who
honestly and faithfully attend to the scriptures. All that is wanting is to
care to read them, and an honest heart, free from wrong biases, to
receive the truth, as they exhibit it. Among these first principles of the
oracles of God, may be, enumerated, the lost state of man by nature:
the absolute need of regeneration: the nature of it as consisting in the
implantation of a holy temper of heart or true love to God:—that what
Jesus Christ did and suffered for fallen man is the sole meritorious
ground of our pardon, and acceptance with a holy and sin-hating God:
—the incarnation of the divine Saviour, and his sufferings to expiate
human guilt:—the universal resurrection: a righteous judgment:—and
eternal retribution. To these we may add, the great and essential duties
and virtues of piety and morality or of the gospel—the need of
repentance towards God and in what it consists: faith towards Jesus
Christ: constancy in the exercises of devotion:—strict justice—
benevolence, peace, and condescension—forgiveness of injuries—love
to enemies—humility, patience, temperance, and self-denial. Can any
one, who has ever read the sacred pages with any care, affirm that these
are not set before us, as strongly as language can express them? Are
they not often repeated? Are they not pressed upon the conscience, in
a variety of ways, and elucidated by beautiful metaphors and figures?
And they are pleasingly illustrated, I mean the duties of piety and
Virtue, in the life and character of the divine author of Christianity. He,
Welcome to our website – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.

More than just a book-buying platform, we strive to be a bridge


connecting you with timeless cultural and intellectual values. With an
elegant, user-friendly interface and a smart search system, you can
quickly find the books that best suit your interests. Additionally,
our special promotions and home delivery services help you save time
and fully enjoy the joy of reading.

Join us on a journey of knowledge exploration, passion nurturing, and


personal growth every day!

ebookmasss.com

You might also like