Power Query: The Hidden Feature of Excel To Clean Dirty Data in Minutes

Learn how Power Query, a tool embedded in your current version of Excel can help you to clean dirty data that is made up of multiple levels, but without any headings or format.

It only takes a few clicks to clean this data and then we can analyze it using a Excel Pivot Table.

A Quick and simple step by step tutorial on using Power Query in Excel and then Pivot Tables to Analyze the data, and Slice it using Slicers.

How To Clean Dirty Data With Microsoft Power Query within Excel & Power BI

Presented by Vinai Prakash, Founder of ExcelChamp.Net

Practice Excel File for Your Benefit 

This video demonstrates Power Query in Microsoft Excel 365, Excel  2019, Excel 2021, Excel 2016, Excel 2013, Excel 2010.

The key data cleanup tools within Power Query that are demonstrated are:

  •  How to Transpose the data in Power Query
  •  How to Change the Name of a Query in Power Query
  •  How the steps of the cleanup are recorded within Power Query
  •  How to Rename Columns in Power Query
  •  How to Promote the First Row as Headers in Power Query
  •  How to Fill Down Values from the rows above in Power Query
  •  How to Unpivot Other Columns in Power Query
  •  How to Save & Load the Cleaned up Data in Power Query
  •  How to Create a Pivot Table in Microsoft Excel
  •  How to Filter Data in a Pivot Table
  •  Limitations of the Filter Section in an Excel Pivot Table
  •  How to Add a Slicer in Excel Pivot Tables
  •  How to select multiple values in a Slicer, and
  •  How the Slicer is superior than a Filter in Excel

The Power Query features shown in this video work exactly the same way in Microsoft Power BI also. So you can use this video steps for Power Query within Power BI.

Do like the video, subscribe to our channel, and Give our video a Thumbs Up.

We’d love a comment about how this video helped you. I reply to all comments personally. Thanks!

What is Power Query?

Power Query is a data transformation and data preparation tool available in Microsoft Excel. It is designed to help users import, transform, and combine data from various sources for analysis and reporting purposes. Power Query provides a user-friendly interface and a wide range of data manipulation capabilities, making it easier to clean, reshape, and combine data from multiple sources.

Here are some key features and functionalities of Power Query in Excel:

  1. Data Import: Power Query allows you to import data from various sources, including databases, Excel files, text files, CSV files, web pages, SharePoint lists, and more. It provides a seamless way to connect to and retrieve data from external sources.
  2. Data Transformation: Power Query provides a set of transformation options to clean and reshape data. You can perform tasks such as removing duplicates, filtering rows, splitting columns, merging tables, changing data types, applying calculations, and performing advanced transformations using a visual interface or custom functions.
  3. Data Connection and Refresh: Power Query enables you to create connections to data sources and set up automatic data refresh. This ensures that your Excel workbook stays up-to-date with the latest data from the connected sources, saving you time and effort in manual data updates.
  4. Data Cleanup and Data Quality: Power Query offers various data cleansing and data quality features. You can perform operations like removing empty rows, handling null values, replacing values, standardizing data formats, and detecting and correcting data inconsistencies.
  5. Query Folding and Performance Optimization: Power Query optimizes query performance by utilizing query folding whenever possible. Query folding pushes data transformations to the underlying data source, resulting in faster and more efficient data retrieval and processing.
  6. Data Combining and Merging: With Power Query, you can easily combine and merge data from multiple sources. It allows you to merge tables based on common columns, append data from multiple tables, and perform complex join operations to create a unified dataset.
  7. Custom Data Transformations: Power Query provides advanced capabilities to create custom data transformations using the M formula language. You can write custom functions, perform complex calculations, and create reusable query components to streamline your data transformation workflows.
  8. Data Visualization and Reporting: Once the data is imported and transformed using Power Query, you can load it into Excel for further analysis or create reports using Excel’s data visualization tools, such as PivotTables, PivotCharts, and Power View.

Power Query is available as a built-in feature in Excel 2016 and later versions. It offers a powerful and intuitive way to clean, shape, and combine data from various sources, empowering users to perform advanced data analysis and reporting tasks with ease.

Who Should Learn Power Query?

Power Query is a powerful data transformation and preparation tool in Excel that can benefit a wide range of individuals and professionals.

Here are some key groups of people who should consider learning Power Query:

  1. Data Analysts and Business Analysts: Data analysts and business analysts who work extensively with data can greatly benefit from learning Power Query. It enables them to import and transform data from multiple sources, clean and reshape data, and create consolidated datasets for analysis and reporting purposes.
  2. Excel Power Users: Individuals who are already proficient in Excel and frequently work with data can enhance their skills by learning Power Query. It provides advanced data manipulation capabilities beyond Excel’s built-in functions and features, allowing for more efficient and flexible data preparation.
  3. Financial Professionals: Professionals in finance and accounting roles can leverage Power Query to streamline data analysis and reporting tasks. It enables them to import and combine financial data from various sources, perform data cleansing and transformations, and generate accurate and customized financial reports.
  4. Data Scientists and Researchers: Data scientists, researchers, and individuals working in data-intensive fields can use Power Query to preprocess and prepare data for analysis. It enables them to import and combine large datasets, handle data cleaning and transformation tasks, and create structured datasets ready for advanced analysis.
  5. IT Professionals and Data Engineers: IT professionals and data engineers who are involved in data integration and management can benefit from Power Query. It allows them to connect to various data sources, transform and cleanse data, and prepare it for further processing or loading into data warehouses or data lakes.
  6. Project Managers: Project managers who work with data and need to consolidate and analyze project-related information can use Power Query to streamline their data preparation workflows. It enables them to combine data from different project sources, clean and reshape project data, and create consolidated reports or dashboards.
  7. Sales and Marketing Professionals: Sales and marketing professionals can utilize Power Query to extract and transform data from CRM systems, web analytics tools, and other marketing platforms. It enables them to analyze and consolidate sales and marketing data, create custom reports, and derive insights to optimize sales and marketing strategies.
  8. Administrators and Operations Professionals: Professionals responsible for managing administrative tasks, operations, and data-driven processes can benefit from learning Power Query. It allows them to import and transform data from various systems, automate data cleaning and preparation, and streamline operational workflows.
  9. Educators and Trainers: Educators and trainers who teach data analysis or Excel-related topics can enhance their curriculum by including Power Query. Teaching Power Query equips students with valuable skills in data preparation and manipulation, enhancing their data analysis capabilities.
  10. Any Excel User Seeking Advanced Data Preparation Skills: Even individuals who use Excel for personal or basic business purposes can benefit from learning Power Query. It provides them with advanced data manipulation capabilities, enabling them to clean, transform, and combine data effectively.

Learning Power Query can benefit individuals in various roles and industries, empowering them to efficiently handle data preparation tasks and derive valuable insights from their data.

Is Power Query Easy To Learn?

Power Query is generally considered to be user-friendly and relatively easy to learn, especially for individuals who are already familiar with Excel. Here are a few factors that contribute to the ease of learning Power Query:

  1. Visual Interface: Power Query provides a visual interface within Excel, allowing users to perform data transformations and manipulations through a series of intuitive steps. The interface provides a clear representation of the applied transformations, making it easier to understand and modify the data preparation process.
  2. Intuitive Operations: Power Query offers a wide range of built-in transformations and operations that can be applied to data. These include filtering, sorting, splitting columns, merging tables, pivoting, and much more. The operations are designed to be user-friendly and logical, making it easier for users to select and apply the required transformations.
  3. Query Dependencies and Applied Steps: Power Query keeps track of the applied transformations and presents them as a series of applied steps. Each step is displayed in a structured manner, allowing users to review, modify, or remove any step in the data preparation process. The ability to view and edit applied steps provides transparency and makes it easier to troubleshoot and adjust the transformations.
  4. Query Editor Preview: Power Query provides a preview feature that allows users to see the results of applied transformations in real-time. This live preview helps users understand the impact of each step and make adjustments as needed, ensuring the desired data output.
  5. Reusability and Automation: Power Query supports the creation of reusable queries, which can be applied to multiple datasets. Users can define a set of transformations once and then reuse them on different data sources, saving time and effort. Power Query also allows for automation by enabling users to set up scheduled data refreshes or create connections to external data sources.

While Power Query is generally considered user-friendly, the complexity of data transformation tasks can vary. Advanced data transformations or complex data structures may require more in-depth understanding and practice.

With the availability of classroom trainings, documentation, and community support, users can find ample resources to assist them in learning and mastering Power Query.

Intellisoft Training runs a Power BI MasterClass, which covers quite a bit of cleanup of data using Power Query functions and features.

Feel free to join it, or engage Intellisoft for a Corporate Training on Data Analytics & Data Visualization With Power BI

Overall, users with basic Excel skills and a willingness to explore and experiment can quickly grasp the concepts and functionalities of Power Query  in Power BI and start utilizing it for data preparation and analysis tasks.

I hope you enjoyed this article, and the Power Query video. Do write a comment, and let me know what you liked about it.

Cheers,
Vinai Prakash
Founder of ExcelChamp.Net

 

Excel for Business and Productivity

Excel is a versatile and indispensable tool in the business world, providing a wide range of features and capabilities that can significantly enhance productivity.

From basic data entry and calculations to advanced data analysis and visualization, Excel offers a comprehensive suite of functions that empower business users to efficiently manage and analyze their data.

This article aims to explore the various ways in which Excel can be leveraged for business and productivity purposes.

Whether you’re a small business owner, a financial analyst, or a project manager, understanding Excel’s features and learning how to harness its power can greatly improve your efficiency and decision-making.

Table of Contents

I. Introduction

  • A. Importance of Excel in the Business World
  • B. Overview of Excel’s Features and Capabilities
  • C. Purpose and Benefits of the Article

II. Excel Basics for Business Users

  • A. Understanding the Excel Interface
  • B. Navigating and Managing Worksheets
  • C. Working with Cells, Rows, and Columns
  • D. Data Entry and Formatting Best Practices

III. Essential Excel Functions for Business Analysis

  • A. Mathematical and Statistical Functions
    • 1. SUM, AVERAGE, MAX, MIN, etc.
    • 2. COUNT, COUNTIF, COUNTA, etc.
    • 3. Statistical Functions: STDEV, VAR, etc.
  • B. Logical Functions for Decision Making
    • 1. IF, IFERROR, AND, OR, NOT, etc.
    • 2. Nested IF Statements
  • C. Lookup and Reference Functions
    • 1. VLOOKUP, HLOOKUP, INDEX, MATCH, etc.
    • 2. Using Named Ranges for Efficient Formulas
  • D. Date and Time Functions
    • 1. TODAY, NOW, DATE, TIME, etc.
    • 2. Calculating Time Differences and Durations

IV. Advanced Data Analysis and Visualization in Excel

  • A. Sorting and Filtering Data
    • 1. Sorting Data by Multiple Criteria
    • 2. Applying Filters and Advanced Filtering Techniques

 

  • B. PivotTables and PivotCharts
    1. Creating PivotTables for Data Summarization
    2. Visualizing Data with PivotCharts

 

  • C. Data Validation and Conditional Formatting
    1. Setting Data Entry Rules and Restrictions
    2. Highlighting Data Based on Custom Conditions

 

  • D. What-If Analysis and Goal Seeking
    • 1. Using Scenario Manager for Sensitivity Analysis
    • 2. Goal Seek for Finding Desired Outcomes

V. Collaboration and Automation with Excel

  • A. Sharing and Protecting Workbooks
    • 1. Sharing Workbooks with Co-workers
    • 2. Password Protection and File Security
  • B. Data Import and Export
    • 1. Importing External Data Sources
    • 2. Exporting Excel Data to Different Formats
  • C. Automating Tasks with Macros
    • 1. Recording and Running Macros
    • 2. Increasing Efficiency with VBA Programming

VI. Excel Tips and Tricks for Increased Productivity

  • A. Keyboard Shortcuts for Common Actions
  • B. Customizing Excel’s Quick Access Toolbar
  • C. Using Templates and Custom Formats
  • D. Hidden Features and Lesser-Known Functions

VII. Real-World Applications of Excel in Business

  • A. Financial Analysis and Modeling
  • B. Budgeting and Expense Tracking
  • C. Sales and Inventory Management
  • D. Project Management and Timelines

VIII. Conclusion

  • A. Recap of Excel’s Importance for Business and Productivity
  • B. Encouraging Further Learning and Practice
  • C. Final Thoughts and Key Takeaways

I. Introduction to Excel For Business & Productivity

A. Importance of Excel in the Business World

Excel has become a cornerstone of business operations, playing a crucial role in financial analysis, budgeting, inventory management, and much more. Its ability to handle vast amounts of data and perform complex calculations makes it an invaluable asset for businesses of all sizes.

Excel allows users to create dynamic reports, generate insightful charts and graphs, and automate repetitive tasks, enabling better data-driven decision-making and streamlining workflow processes.

With Excel, businesses can efficiently analyze and interpret their data, identify trends and patterns, and gain actionable insights to drive growth and success.

B. Overview of Excel’s Features and Capabilities

Excel offers a wide range of features and capabilities that make it a powerful tool for business users. From basic functions like data entry and formatting to advanced data analysis techniques like PivotTables and macros, Excel provides a comprehensive toolkit.

It offers mathematical and statistical functions for performing calculations, logical functions for decision-making, and lookup and reference functions for data retrieval. Additionally, Excel enables sorting and filtering of data, data validation, conditional formatting, and what-if analysis.

With its collaborative features, users can share workbooks with colleagues, import and export data, and even automate tasks with macros. Excel’s versatility and flexibility make it an essential software for businesses across industries.

C. Purpose and Benefits of the Article

The purpose of this article is to provide business professionals with a comprehensive understanding of Excel’s capabilities and how it can boost productivity.

By exploring Excel’s basics, essential functions, advanced data analysis techniques, collaboration and automation features, and practical applications, readers will gain insights into leveraging Excel effectively in their day-to-day business operations.

The article aims to equip readers with the knowledge and skills needed to improve data management, streamline processes, and make informed decisions using Excel. Whether you’re a beginner or an experienced user, this article will serve as a valuable resource for maximizing Excel’s potential in a business context.

II. Excel Basics for Business Users

A. Understanding the Excel Interface

Excel’s interface consists of various elements that allow users to navigate and work efficiently. The ribbon at the top contains tabs with different groups of commands related to formatting, formulas, data analysis, and more.

The workbook consists of individual worksheets, identified by tabs at the bottom, where data and calculations are performed. Users can navigate between worksheets by clicking on the tabs or using keyboard shortcuts.

The cells, rows, and columns form the main grid where data is entered, and formulas are applied. Understanding how to navigate and utilize these basic elements of the Excel interface is crucial for efficient use of the software.

B. Navigating and Managing Worksheets

Excel allows users to create multiple worksheets within a single workbook, which is beneficial for organizing and managing data.

To navigate between worksheets, users can simply click on the desired tab or use keyboard shortcuts like Ctrl+Page Up or Ctrl+Page Down. Additionally, Excel provides options to insert, delete, and rename worksheets as needed.

Renaming worksheets with descriptive names helps users identify and locate specific information easily. It’s also possible to group worksheets for simultaneous formatting or data entry.

Learning how to navigate and manage worksheets efficiently enhances productivity and simplifies data organization.

C. Working with Cells, Rows, and Columns

Cells are the basic building blocks of Excel, where data is entered and manipulated. Users can select cells by clicking and dragging, or by using the Shift or Ctrl keys along with the arrow keys.

Once selected, cells can be formatted, and formulas can be applied. Rows and columns play a crucial role in organizing and manipulating data.

Users can insert or delete rows and columns as necessary, and adjust their width and height to accommodate content. Excel provides features like autofill to quickly fill a series of cells with a pattern or sequence.

Understanding how to work with cells, rows, and columns efficiently is essential for managing and analyzing data effectively.

III. Essential Excel Functions for Business Analysis

A. Mathematical and Statistical Functions

Excel offers a wide range of built-in mathematical and statistical functions that simplify business analysis.

Basic functions like SUM, AVERAGE, MAX, and MIN enable users to quickly calculate totals, averages, and find the highest and lowest values within a range of cells. COUNT, COUNTIF, and COUNTA assist in counting cells that meet specific criteria or are non-empty.

Statistical functions like STDEV (standard deviation) and VAR (variance) help in analyzing data dispersion and variability. By utilizing these functions appropriately, business users can gain insights from their data efficiently.

B. Logical Functions for Decision Making

Logical functions in Excel allow users to perform conditional evaluations and make decisions based on specific criteria.

The IF function, for example, evaluates a condition and returns a value based on whether the condition is true or false. IFERROR handles errors gracefully by returning a specified value when an error occurs.

Logical functions like AND, OR, and NOT help users combine multiple conditions to perform more complex evaluations. Nested IF statements allow for even more intricate decision-making processes.

By mastering logical functions, business users can automate decision-making processes and streamline their data analysis.

C. Lookup and Reference Functions

Lookup and reference functions in Excel are valuable tools for finding and retrieving information from large datasets.

VLOOKUP is commonly used to search for a specific value in the leftmost column of a table and return a corresponding value from another column.

HLOOKUP works similarly but searches in the top row of a table.

INDEX and MATCH, on the other hand, offer more flexibility by allowing users to search horizontally and vertically within a dataset. By using named ranges, which are user-defined names for specific cell ranges, users can enhance the efficiency and readability of their formulas.

These lookup and reference functions empower business users to extract relevant information from their data quickly.

IV. Advanced Data Analysis and Visualization in Excel

A. Sorting and Filtering Data

Sorting data in Excel allows users to arrange information in ascending or descending order based on selected criteria. It is particularly useful for organizing large datasets alphabetically, numerically, or by date.

Excel provides options for sorting data by multiple criteria, enabling users to prioritize specific factors. Filtering data helps in narrowing down large datasets to display only the desired information.

Excel’s filtering capabilities allow users to apply custom criteria, such as filtering by specific values or conditions. Advanced filtering techniques, including wildcard characters and filtering by color or icon, provide additional flexibility. By mastering sorting and filtering functions, business users can easily analyze and work with extensive datasets.

B. PivotTables and PivotCharts

PivotTables are powerful tools in Excel that allow users to summarize and analyze large amounts of data quickly. By dragging and dropping fields, users can generate summary tables that provide insights into the data from different perspectives.

PivotTables can perform calculations, such as sums, averages, and counts, and can also group data based on various criteria.

PivotCharts, which are visual representations of PivotTable data, provide a clear and concise way to present and communicate trends and patterns.

With PivotTables and PivotCharts, business users can explore and analyze complex datasets with ease, making informed decisions based on the generated visualizations.

C. Data Validation and Conditional Formatting

Data validation in Excel enables users to set rules and restrictions on the data entered in specific cells. This helps maintain data integrity and ensures consistency. Users can define criteria such as data type, range, or specific values that are allowed or not allowed in a cell. Conditional formatting allows users to apply formatting rules based on specific conditions.

This feature helps highlight important information, identify trends, or draw attention to specific values in a dataset. By utilizing data validation and conditional formatting effectively, business users can improve the accuracy and readability of their data, facilitating better decision-making.

D. What-If Analysis and Goal Seeking

Excel provides tools for performing what-if analysis, allowing users to explore different scenarios and evaluate the impact of changing variables on formulas and calculations. By using data tables, users can see the resulting values based on different input combinations.

Goal Seek is another valuable tool that helps users determine the input required to achieve a specific goal. It allows users to specify a desired outcome and automatically calculates the input necessary to reach that goal. These features enable business users to perform sensitivity analysis, assess potential outcomes, and make informed decisions based on different scenarios.

Please note that this is a shortened version of the complete article, but it should give you a sense of how to expand each topic and subtopic. Feel free to further elaborate on each point as needed to create a comprehensive article on Excel for business and productivity.

V. Collaboration and Automation with Excel

A. Sharing and Protecting Workbooks

Sharing workbooks in Excel allows for seamless collaboration among team members. Users can invite others to view, edit, or comment on the workbook, enabling real-time collaboration.

Excel provides options to set permissions, such as read-only access or granting editing rights to specific individuals. Furthermore, protecting workbooks with passwords adds an extra layer of security to sensitive information. By leveraging the sharing and protection features of Excel, businesses can foster teamwork, streamline workflows, and safeguard their data from unauthorized access.

B. Data Import and Export

Excel offers a variety of methods for importing and exporting data, facilitating seamless integration with other systems and applications. Users can import data from various sources, such as databases, text files, and web sources, allowing for easy data consolidation and analysis. Similarly, exporting data from Excel to different formats, including CSV, PDF, or XML, provides versatility in sharing information with others. The ability to import and export data effortlessly enhances collaboration, enables data integration, and simplifies the exchange of information with external stakeholders.

C. Automating Tasks with Macros

Macros in Excel enable users to automate repetitive tasks and streamline workflows, ultimately saving time and increasing productivity.

A macro is a recorded series of actions that can be replayed with a single click or assigned to a keyboard shortcut. Users can automate tasks such as data formatting, report generation, and complex calculations.

Advanced users can even utilize Visual Basic for Applications (VBA) to create custom macros with more complex logic and interactivity.

By harnessing the power of macros, businesses can automate routine processes, reduce errors, and focus on more value-added activities.

VI. Excel Tips and Tricks for Increased Productivity

A. Keyboard Shortcuts for Common Actions
Excel offers a wide range of keyboard shortcuts that can significantly improve efficiency and speed up tasks. Shortcuts for commonly used actions such as copying and pasting, navigating between cells, formatting data, and performing calculations can save considerable time and effort. Learning and utilizing these keyboard shortcuts can boost productivity and streamline workflows, allowing users to work more efficiently with Excel.

B. Customizing Excel’s Quick Access Toolbar
The Quick Access Toolbar in Excel provides quick and easy access to frequently used commands.

Users can customize this toolbar by adding their most frequently used commands, ensuring that they are readily available at all times.

Customizing the Quick Access Toolbar eliminates the need to navigate through various tabs and ribbons, reducing the time spent searching for specific commands and enhancing productivity.

C. Using Templates and Custom Formats
Excel templates offer pre-designed formats and structures for specific purposes, such as budgeting, project management, or sales tracking.

By utilizing templates, users can save time by starting with a preformatted sheet and tailoring it to their needs.

Additionally, users can create and apply custom formats to enhance the visual appeal and readability of their data.

Custom formats allow for consistent styling and branding, improving the overall professionalism of reports and presentations.

D. Hidden Features and Lesser-Known Functions

Excel is packed with hidden features and lesser-known functions that can greatly enhance productivity and efficiency.

These features may include advanced filtering options, data validation techniques, advanced formula auditing tools, or powerful data analysis add-ins.

Exploring and learning about these hidden gems can unlock additional functionality and streamline processes in Excel, enabling users to leverage the full potential of the software.

VII. Real-World Applications of Excel in Business

A. Financial Analysis and Modeling

Excel is widely used in financial analysis and modeling, enabling businesses to evaluate financial data, create forecasts, and make informed decisions.

With its mathematical and statistical functions, Excel can perform complex calculations, generate financial ratios, and analyze trends.

By utilizing Excel’s capabilities, businesses can create robust financial models, perform sensitivity analysis, and assess investment opportunities, ultimately improving financial planning and decision-making.

B. Data Visualization and Reporting

Excel’s charting and graphing features enable businesses to create visually appealing and insightful data visualizations.

Users can transform raw data into meaningful charts, graphs, and dashboards, allowing for better data interpretation and communication.

Excel offers a wide range of chart types, customization options, and interactive features, empowering businesses to present data in a visually compelling manner, enhancing reporting and presentation capabilities.

C. Project Management and Tracking

Excel provides valuable tools for project management and tracking, allowing businesses to plan, monitor, and control project activities.

With Excel, users can create project timelines, allocate resources, track progress, and analyze project performance.

Excel’s features, such as conditional formatting and Gantt chart templates, simplify project management processes, aiding in effective project planning, scheduling, and reporting.

VIII. Conclusion

Excel is an indispensable tool for businesses seeking to improve productivity and make data-driven decisions.

Its wide range of features, from basic data entry and calculations to advanced data analysis and visualization, enables businesses to efficiently manage and analyze their data.

By leveraging Excel’s collaboration and automation capabilities, businesses can foster teamwork, streamline processes, and save time.

The various tips and tricks, along with real-world applications discussed in this article, serve as a roadmap for maximizing Excel’s potential and boosting productivity in a business context.

With Excel’s versatility and power, businesses can gain valuable insights, make informed decisions, and achieve their goals more effectively.

We invite you to attend the Best Advanced Excel Course in Singapore, and benefit from it. You’ll be amazed at your efficiency and productivity by learning so many tips and tricks in Excel in just 2-3 days.

 

How to Subtract a Date From Today in Excel

Even though Microsoft Excel spreadsheet software was created for numerical calculations, we often have dates within our data, and we need to calculate elapsed days, weeks, months, years, or sometimes just working days.

Fortunately, Excel has you covered pretty well.

All of these operations are easily possible, and we can calculate anything related to dates – be in working days, months, or years, using a plethora of Excel functions and a number of ways.

How Are Dates Stored in Microsoft Excel

When you type a date in Excel, it appears as a Date. In the format section, you will even see it as a Date Format. But strangely, Microsoft Excel has no special way of determining dates as a Date data type. So a Date value is stored as a number in Excel. This trend was started by Lotus 1-2-3, the spreadsheet that predates Microsoft Excel.

So when you type a date in Excel, it is converted to a number – a serial number to be exact. This serial number starts from 1-March-1900. This first date was numbered 1, and then subsequent dates were calculated by adding days to this number.

If you don’t believe me, simply type a date and then change its type from Date to General. You’ll see a large number appear instead of the date. Something like 44762. The serial number you get might be higher or lower than this number, depending on the date you have keyed in.

While you may be puzzled by the fact that dates are being stored as serial numbers in Excel, it is in fact a boon for us.

Now we can perform arithmetic with the dates, as they are not really “dates” but rather “numbers”.

Do take note that based on your regional settings, you might see the date pre-formatted as DD/MM/YY or MM/DD/YY.

Further, you might see a two-digit year or a four-digit year. To tweak the way dates appear, you can change the format by picking up a suitable Custom Format.

How To Find Today’s Date

You can find the current date by using the Excel function TODAY. This is an empty function and does not take any arguments. Simply write =TODAY(), and you will get today’s date.

This makes it easy to make other dates, like tomorrow and yesterday, with the help of the today function.

Today =TODAY()

Tomorrow =TODAY() + 1

Yesterday = TODAY() – 1

Similarly, you can add or subtract any number of days from a starting date by using this method. Do try it out on any given date.

If you want to see the date with time, you can use the equivalent time function of Excel – NOW()

When you use NOW(), you get the date, along with the current time. Both the TODAY() & NOW() are dynamic functions, and every time any other function is evaluated in Excel, the Today & Now functions would get updated too to the latest current date and time.

How to Subtract a Date from Today

Instead of making future or past dates, you might already have a date, like the date of birth, and now you want to find the age of a person.

This can be achieved by subtracting the second date from the first date. So in our case, we will subtract the date of birth from Today’s date.

As an example, if the cell A2 contains the date of birth and the cell B2 contains Today’s date, then we can compute the difference between the two dates in cell C2 with the following formula:

=B2 – A2

You can try this on a blank Excel sheet.

The above formula will result in a number being shown in cell C2. The number obtained is the number of days difference between the two dates. Keep in mind that whenever you use this formula, you may receive a positive value or a negative value, depending on how you subtract dates.

If you subtract the earlier date from the current date, you will get a positive number, and when subtracting the current date from a previous date will give you a negative number.

How to Find the Age of a person in Excel

Calculating the number of days elapsed between 2 dates and getting a number is good, but if you want to calculate the Age of a person, having the difference in days isn’t much useful. We now need to convert the elapsed days into number of years, the number of months and the number of Days.

Calculating these three things manually can require a lot of calculations, using the Day functions of Excel. We can use many different ways to calculate the difference in Excel dates.

There’s an absolute gem of a function called the DATEDIF function in Excel, which is actually meant for subtracting dates, and find the difference between dates in elapsed days. It can tell you the difference in Years, Months & Days, depending on the third argument provided within the function.

I generally prefer this easy way to find the difference in days between specific dates. Datedif takes the following arguments.

DATEDIF(start_date, end_date, unit)

In this function, the first argument is the start date. The second argument is the end date or the due date. The unit can be anything from the list below.

“Y” returns the number of complete years in the period.

“M” returns the number of complete months in the period.

“D” returns the number of days in the period.

“MD” returns the difference between the days in start_date and end_date. The months and years of the dates are ignored.

“YM” returns the difference between the months in start_date and end_date. The days and years of the dates are ignored.

“YD” returns the difference between the days of start_date and end_date. The years of the dates are ignored. Only the difference between the dates without the years, is calculated.

So to calculate the complete years between any 2 selected dates, we can use the DATEDIF function in the third blank cell. The date_of_birth cell references the start date.

The todays_date cell references the cell where we have written =TODAY() to get Today’s date.

=DATEDIF(date_of_Birth, todays_date, “Y”)

To calculate the complete months after the years, we can use:

=DATEDIF(date_of_Birth, todays_date, “YM”)

And to calculate the complete days between 2 dates ignoring months and years, we can use:

=DATEDIF(date_of_Birth, todays_date, “MD”)

And to calculate the exact age, we can then combine the 3 functions, using the CONCATENATE Method, or using the & operator.

In the simple formula below, we calculate the complete age of a person born on 6-December-1966, and Today’s date being 30-July-2022.

You can copy and paste this formula and then hit the Enter key.

=DATEDIF(date_of_birth, todays_date, “Y”) & ” Years, ” & DATEDIF(date_of_birth, todays_date, “YM”) & ” Months and ” & DATEDIF(date_of_birth, todays_date, “MD”) & ” days”

For the formula result, you will see

How to Separate Day, Month & Year from any Date

There are several Date & Time Functions in Excel, that can be very clinical and separate out some components of the date, like the days, months or years, as desired.

To get the Day, we use the Day Function:

=DAY( TODAY() ) gives the date like 30

=MONTH( TODAY() ) gives the month as a number from 1 to 12.

As an example, the month function can be helpful in finding out the month of the invoice date. If you have multiple dates in a table, you can simply pull the fill handle and get Excel to calculate the months of all dates.

=YEAR( TODAY() ) gives the year of the year, like 1966 or 2022. Future values of the Year function will yield 2023, 2024 etc.

Calculating Working Days Between 2 Dates

The DateDif function calculates the number of days between two days. While it is suitable for age, sometimes you want to calculate working days, excluding the weekends.

So you may want to exclude Saturday or Sunday or both, or any other weekday from the calculation and work with only business days as the total number of days elapsed.

In this case, you can use the NETWORKDAYS() function of Microsoft Excel.

Here’s the step-by-step detailed article on how to calculate the difference between two days without the weekends.

Find Age in Years From the Date of Birth in Excel

How To Center a Title in Excel

A centred title looks so much better in Excel reports or charts. I have seen many users and even management requests for the chart title to be in the center of the report or Excel chart.

There are several ways to center a report title in Microsoft Excel. And most of these techniques will work in any version of Excel. So if you have had any of these versions of Microsoft Excel, you are safe.

This tip is applicable to Excel 2003, Excel 2007, Excel 2010, Excel 2013, Excel 2016, Excel 2019 or the latest Microsoft Office Excel 365.

title in center in Excel

Please check out both of these methods and my warning about their usage. Finally, read my preferred and recommended actions while centring titles in Excel spreadsheets.

Method 1: Merge and Center Title Text

Step 1: Select the range of cells where you want to center the text item. Take note that the text you want to center must be in one of these cells. Further, there should be no other text in the selected range, or it will be overwritten. Microsoft Excel will keep the text in the top-left cell of the selected range, and discard any other text in the selected range.

Step 2: Click on the Merge and center button. This is present on the Home Tab, under the Alignment group. It looks like 2 cells on top, a double-headed arrow, and 2 cells at the bottom.

Merge and center in Excel

The selected text is merged and centered in the selection. If multiple rows were selected, the centered text will be at the bottom row.

In case you want to align the text in the middle too, you have to click on the Middle Align icon in the formatting toolbar. Now the text should be exactly in the middle horizontally and vertically.

Middle Align in Excel

CAUTION: While you may like this method of merging and centering text, because of its ease and convenience, we do not recommend to merge cells in Excel worksheets.

All Excel pros adhere to this rule – never merge cells, unless you are presenting it in a report or dashboard, as an end result. Raw data should never be in merged cells.

Merged cells can cause havoc while trying to sort data.

Basically, you can’t sort data if it contains even a single merged cell. So you have to unmerge the cells before you can sort it.

Further, data in an Excel Table can’t be merged too. This is because sorting and filtering get affected if you merge cells in Excel. In this case, you have to convert the Excel table into a normal range. Then only you can centre the text.

Method 2: Center Across Selection

Some of the older versions of Excel did not contain the Merge and center option in the ribbon. This method 2 works when you are using such older versions,s but it also works in newer versions of Microsoft Excel, including Office 365.

And this method does not merge the cells. It only centers the text. Thus, our earlier problem with merged cells is actually eliminated.

To use this “Center across Selection” method, do the following steps:

Step 1: Select the multiple cells where the text is to be centered. The text should be present within this range.

Step 2: Click on Format Cells (Shortcut Control + 1 on Windows). Or right click the mouse button on the selection, and pick Format Cells from the Options menu.

center across selection in Excel

Step 3: On the Format Cells dialog box, stay on the Alignment Tab. In the Text alignment dropdown showing “Horizontal“, you will see the default alignment set to “General“. Pick “Center across Selection” from the selection. See screen shot below.

This will center the text across the selection. But the cells won’t be merged. This is the preferred way of centering a title in Excel.

How to Unmerge Cells in Excel

If you have clicked on Excel’s Merge and center text icon, and now decided to unmerge it, just select the text, and click on the “Merge and center” icon again. This button acts like a toggle switch. The merged cells will be unmerged, and the centered text will go back into the first unmerged single cell.

How to Align Text within a Single or Merged Excel Cell

If large cells, the text may appear at the bottom left corner. If you want to change the cell alignment vertically and horizontally, you need to click the Middle Align button & Center buttons under the Alignment group under Home Tab. Now the text will move to the center of the cell.

How to Center a Title in Excel Charts

When you create an Excel Chart, by default a Chart Title is added in the centre. In some old versions of Excel, you might not get the Title in the Chart. And in some cases, Excel can’t figure out what title to put, because the column name happens to be blank. In this case, you will end up without a chart title at all. But you can add a chart title by hand, manually and then center it.

Chart With Title in Center

Steps to Center the Chart Title in Excel

  1. Click the Green + icon on the top right of the Chart (applies to Excel 2013, 2016, 2019, Office 365 spreadsheets).
  2. The Chart Elements will be displayed. Click the Checkbox on Chart Title. A Chart title is now placed in the top center of the Chart.

    Adding a Chart Title in Excel

  3. You can click inside the text box, and type any appropriate title text. It will be centered by default.

Print Excel worksheets with Worksheet titles in header or footer of the print out

  1. Go to Page Layout.
  2. Choose Page Setup popup from the bottom right flyout menu.

    File Name in center of page

  3. Choos Header/Footer tab from the Page Setup popup
  4. Click Custom Header or Custom Footer option. Another Header or Footer Popup will open.
  5. Click the Green Excel icon and the File name will be printed in the Left section.
  6. Click inside the Right section, and then click on the page number # icon. The page number will now be printed in the right section.
  7. You can display the current date in the Center section.
  8. When you do a Print Preview, you will see a beautifully formatted Report, with the date centred, the file name on the left, and page number in the right section.

At ExcelChamp, we conduct a training course for Excel Formatting & Formula Tips & Tricks, which covers such formatting tips for beginner & advanced users alike.

Hope you enjoyed the tips presented here. They are pretty simple and easy to implement. Go ahead and amaze your audience with amazing charts, reports and analysis done in Excel.

Cheers,
Vinai Prakash,
Founder & Master Trainer at ExcelChamp.Net

 

Find Age in Years within Microsoft Excel [Video Tutorial]

Wondering How To Find the Age in Years from Date of Birth, in Microsoft Excel?

See multiple ways to calculate Age in Excel from any date of birth.

This simple, step-by-step tutorial on finding the age in Excel from date of birth or any other date, work on Microsoft Office 365, Microsoft Excel 2019, Excel 2016, Excel 2013, Excel 2010, Excel 2007 & Excel 2003 too.

We cover Microsoft Excel Functions & Formulas that allow you to calculate the following things in Excel:

  1. Find the age in Years
  2. Find the Age in Months
  3. Find the Age in Days
  4. Finding the exact age in Years, Months & Days.
  5. Combining Years & Months to create a Text String the way we want.

Here’s how to calculate the number of years since the date of birth

Not only the years we can also calculate the months. I will show you multiple techniques to calculate the age in years, months & days.

If you want a whole number or you want the age as a fraction, there are so many ways to do it.

What we want to calculate is the age in years –  something like Age is 55 years. Or Age is 55.56 years.

Before we start i want to highlight to you that the date of birth that you are using should be a date field so you can select it and make sure the formatting is not General or text, but it should be set as a short date or any kind of date.

To calculate the years,  the formula is extremely simple. We will be using the DATEDIF function of Excel.
=DATEDIF(DateofBirth, TODAY(), “Y”)

Similarly, we can calculate the age in months too.

=DATEDIF(DateofBirth, TODAY(), “M”)

This will result in the number of months from the date of birth to today’s date. You might see a huge number like 666 here.

But you may not want this.  Perhaps we only want how many months after the 55 whole years have elapsed.

In this case,  we modify the formula from only “M” to “YM”

=DATEDIF(DateofBirth, TODAY(), “YM”)

YM means it is only the months after the completed years. By doing this we can see that only six months have elapsed after 55 years.

Finally, we only need the days that have elapsed after the completed months in the age.

=DATEDIF(DateofBirth, TODAY(), “D”)

This will tell you that 20,000 days have passed from the date of birth, but, of course, we don’t want this.

So you change D to MD. The “MD” tells Excel to calculate how many days after the month have elapsed. 

As you can see, we have the age calculated in different cells – the age is 55 years 6 months and 9 days exactly till today.

If you wish to see a complete combined date, you can use the CONCAT function to combine multiple formulas, or use the & to combine text as well.

As an example, we can write

=CONCAT(DATEDIF(dateofbirth,TODAY(),”Y”),” Years, “,DATEDIF(dateofbirth,TODAY(),”YM”),” Months & “,DATEDIF(dateofbirth,TODAY(),”MD”),” Days”)

For a DateofBirth date of 6-December-1966, it generates, 55 Years, 6 Months & 28 Days.

Hope you find this DATEDIF function quite handy for such use. Do give it a try and let us know how you use it.

Cheers,
Vinai

Recommended Reading for Next Steps:

  1. Using Date & Time Functions in Excel
  2. Difference Between 2 Dates, Without the Weekends