<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" version="2.0">
    <channel>
        
        <title>
            <![CDATA[ Benny Ifeanyi Iheagwara - freeCodeCamp.org ]]>
        </title>
        <description>
            <![CDATA[ Browse thousands of programming tutorials written by experts. Learn Web Development, Data Science, DevOps, Security, and get developer career advice. ]]>
        </description>
        <link>https://www.freecodecamp.org/news/</link>
        <image>
            <url>https://cdn.freecodecamp.org/universal/favicons/favicon.png</url>
            <title>
                <![CDATA[ Benny Ifeanyi Iheagwara - freeCodeCamp.org ]]>
            </title>
            <link>https://www.freecodecamp.org/news/</link>
        </image>
        <generator>Eleventy</generator>
        <lastBuildDate>Thu, 28 May 2026 16:46:20 +0000</lastBuildDate>
        <atom:link href="https://www.freecodecamp.org/news/author/Bennykillua/rss.xml" rel="self" type="application/rss+xml" />
        <ttl>60</ttl>
        
            <item>
                <title>
                    <![CDATA[ What is Microsoft Fabric? How to Build a Customer Segmentation Project ]]>
                </title>
                <description>
                    <![CDATA[ Microsoft Fabric is a data analytics tool that can help you streamline all your data needs and workflows, from data integration to analytics and engineering. In this guide, I'll explain what Microsoft Fabric is in more detail, how it works, and walk ... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/what-is-microsoft-fabric/</link>
                <guid isPermaLink="false">66ba5bc6fa3ca700fcc9f230</guid>
                
                    <category>
                        <![CDATA[ data analysis ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Microsoft ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Benny Ifeanyi Iheagwara ]]>
                </dc:creator>
                <pubDate>Tue, 05 Mar 2024 01:00:06 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2024/03/Green-Orange-and-Brown-Collage-Math-Quiz-Presentation-1.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Microsoft Fabric is a data analytics tool that can help you streamline all your data needs and workflows, from data integration to analytics and engineering.</p>
<p>In this guide, I'll explain what Microsoft Fabric is in more detail, how it works, and walk you through building a project with it. If you already have an understanding of the platform, you can skip to the <a class="post-section-overview" href="#heading-how-to-get-started-with-microsoft-fabric-an-end-to-end-project-example-1">Microsoft Fabric project.</a></p>
<p>Here's what you'll learn about in this guide:</p>
<ul>
<li><a class="post-section-overview" href="#heading-what-is-microsoft-fabric">What is Microsoft Fabric?</a></li>
<li><a class="post-section-overview" href="#heading-why-you-should-learn-about-microsoft-fabric">Why you should learn about Microsoft Fabric</a></li>
<li><a class="post-section-overview" href="#heading-microsoft-fabric-architecture">Microsoft Fabric architecture and components</a></li>
<li><a class="post-section-overview" href="#heading-how-to-get-started-with-microsoft-fabric-an-end-to-end-project-example-1">How to get started by building a simple project</a></li>
<li><a class="post-section-overview" href="#heading-how-to-create-a-workspace-in-microsoft-fabric">How to create a workspace in Microsoft Fabric</a></li>
<li><a class="post-section-overview" href="#heading-how-to-create-a-lakehouse-in-microsoft-fabric">How to create a Lakehouse in Microsoft Fabric</a></li>
<li><a class="post-section-overview" href="#how-to-use-kaggle-data-in-microsoft-fabric">How to use Kaggle API data in Microsoft Fabric</a></li>
<li><a class="post-section-overview" href="#heading-how-to-use-the-data-wrangler-in-microsoft-fabric">How to use the Data Wrangler in Microsoft Fabric</a></li>
<li><a class="post-section-overview" href="#heading-how-to-perform-customer-segmentation-in-microsoft-fabric">How to perform customer segmentation in Microsoft Fabric</a></li>
<li><a class="post-section-overview" href="#heading-how-to-visualize-lakehouse-data-in-power-bi">How to visualize your lakehouse data in Power BI</a></li>
</ul>
<h2 id="heading-prerequisites">Prerequisites</h2>
<p>To follow along, you will need to have a Power BI license. You can get one for free to practice with using the <a target="_blank" href="https://learn.microsoft.com/en-us/office/developer-program/microsoft-365-developer-program">Microsoft 365 Developer Program</a>.</p>
<p>It would be also be helpful if you have knowledge of Microsoft Power BI and Python.</p>
<h2 id="heading-what-is-microsoft-fabric">What is Microsoft Fabric?</h2>
<p>Microsoft Fabric is an all-in-one analytics software-as-a-service (SaaS) platform for managing all your data analytics needs and workflows. Microsoft built this end-to-end platform to handle data-related data, from your data storage and migration to your real-time data analytics, data science projects, and data engineering workflow.</p>
<p>But how does it work?</p>
<p>This tool brings together various new and preexisting data tools and technologies—Power BI, OneLake, Azure Data Factory, Data Activator, Power Query, Apache Spark, Synapse Data Warehouse, Synapse Data Engineering, Synapse Data Science, Synapse Real-Time Analytics, Azure Machine Learning, and various connectors.</p>
<h2 id="heading-why-you-should-learn-about-microsoft-fabric">Why You Should Learn About Microsoft Fabric</h2>
<p>The best part of Microsoft Fabric is its simplicity in terms of functionality. Using various technologies together, you can do everything all in one place and focus more on what you can do with it and less on licensing, supporting systems, dependencies, and how to integrate with all these different platforms.</p>
<p>Another benefit of the platform is how it handles your data. This provides and allows you to maintain a single reliable source of information. With Microsoft Fabric’s OneLake, you can have a single, unified data storage. </p>
<p>Microsoft Fabric also has Azure’s OpenAI service integrated into its layer. This way, you can use AI (Co-pilot) to help you discover insights quickly.</p>
<p>Lastly, since it is an all-in-one platform, there is a cost-saving edge since there is no need to subscribe to multiple vendors.</p>
<h2 id="heading-microsoft-fabric-architecture">Microsoft Fabric Architecture</h2>
<p>Think of Microsoft Fabric as your data estate.</p>
<p>Just like every piece of real estate, Microsoft Fabric has various components in its architecture.</p>
<p>Let’s start by looking at the terminology you'll encounter and need to understand when using Microsoft Fabric's architecture:</p>
<h3 id="heading-experiences-and-workloads">Experiences and Workloads:</h3>
<p>These refer to the various capabilities of the platform. Every experience on the platform is tailored with a specific user in mind. </p>
<p>Below are some examples of the various experiences/workloads available. You'll notice that each of them are built for a specific purpose, task, and user. </p>
<ul>
<li><strong>Data factory</strong>: This application gives users over 150 connectors to Lakehouses, warehouses, cloud, and on-premise data sources and orchestrates data pipelines for data transformation. A Lakehouse here refers to a data platform for storing structured and unstructured data. You can also copy your on-prem data to the cloud and load it into OneLake through the Data Factory.</li>
<li><strong>Synapse data engineering</strong> is part of the data engineering experience on the platform. It has some cool features like Lakehouses, built data pipelines, and a Spark engine.</li>
<li><strong>Synapse data warehouse</strong> provides you with a unified and serverless SQL engine. Like your “traditional” data warehouse, you have the full capabilities of your transactional T-SQL features.</li>
<li><strong>Synapse real-time analytics</strong> allows you to stream data from Internet of Things (IoT) devices, telemetry, and logs. You can also use the workload here to analyze semi-structured data using its Kusto Query Language (KQL) capabilities, just like Azure Data Explorer.</li>
<li><strong>Synapse data science</strong> allows you to build, collaborate, train, and deploy fully scalable end-to-end Machine learning (ML) and AI models. You can also carry out your ML experiments in your notebooks and log your models using the Fabric Auto Logging feature. A must-mention tool in this experience is the Data Wrangler, a Fabric graphical user interface for data transformation. With this tool, you can clean your data by simplifying by clicking buttons while the tool automatically generates the Python code for you. It is similar to Power Query.</li>
<li><strong>Business Intelligence with Power BI</strong> helps you quickly turn your business data into insightful analytic reports and dashboards.</li>
<li><strong>Data Activator</strong> allows you to take care of your data observability and monitor workloads in a non-code/low-code way. This tells you when specific data points hit a threshold or match a pattern. You can also automate particular actions and kickoff Power Automates flows when specific conditions occur.</li>
<li><strong>Copilot in Fabric</strong> provides you with an Azure OpenAI Service. This means you can build reports, describe how you want to ingest your data, summarize, explore, and transform your data using the natural language capability of Azure OpenAI.</li>
</ul>
<h3 id="heading-workspaces">Workspaces</h3>
<p>Workspaces are similar to Power BI’s workspace. Here, you can share and collaborate with others and create reports, Warehouses, Lakehouses, dashboards, and notebooks.</p>
<h3 id="heading-capacity-unit-cu">Capacity Unit (CU)</h3>
<p>A CU is the ability of your resource to perform or produce an output.</p>
<p>Now we'll look at the various components of Microsoft Fabric's architecture.</p>
<h3 id="heading-onelake">OneLake</h3>
<p>OneLake is the central data repository for Microsoft Fabric that stores the data in Delta Lake format. Think of it as OneDrive for your data. This repository allows you to explore and find data assets in your organization.</p>
<p>One exciting thing is Shortcuts, which allows you to share or point to data in other locations in OneLake without moving or duplicating the data. This removes any case of data redundancy.</p>
<h3 id="heading-lakehouses-vs-warehouses">Lakehouses vs Warehouses</h3>
<p>While both "houses" hold data, some differences exist between Lakehouses and Warehouses in Microsoft Fabric.</p>
<p>For starters, a Lakehouse can store any data type, whether structured or unstructured. It is, however, stored in the <a target="_blank" href="https://learn.microsoft.com/en-us/fabric/get-started/delta-lake-interoperability">Delta format</a> by default. The Delta format is a storage layer that offers ACID (Atomicity, Consistency, Isolation, Durability) transactions. A Warehouse, on the other hand, is more suited for structured data.</p>
<p>Lakehouses also support Notebooks. So you can work with various languages from PySpark to SQL and R. Warehouses, on the other hand, only use SQL. </p>
<p>Keep in mind, though, that Fabric provides you with two types of Warehouses: SQL Endpoint and Synapse Data Warehouse.</p>
<ul>
<li>SQL Endpoint is auto-generated when a Lakehouse is created. This mean you can have a SQL-based experience and can query Lakehouse data using T-SQL language. </li>
<li>Synapse Data Warehouse is more of your traditional SQL engine. So you can use it to create and query data out of OneLake.</li>
</ul>
<h2 id="heading-how-to-get-started-with-microsoft-fabric-an-end-to-end-project-example">How to Get Started With Microsoft Fabric – An End-to-End Project Example</h2>
<p>To get a glimpse of how the Fabric platform works, we will build a little project.</p>
<p>We'll create a Lakehouse to store a mall dataset from Kaggle using the Kaggle API. We will also transform our data using Data Wrangler. Then, we will perform customer segmentation on our data based on the customer's annual income and spending score using the KMeans clustering algorithm. This will allow us to group the customers into various categories like low income earners that don't spend, average income earning customers, and high income customers who do not spend much.</p>
<p>Let's get started.</p>
<h3 id="heading-how-to-enable-fabric">How to Enable Fabric</h3>
<p>The first thing we need to do is to log into Microsoft Power BI. Here, we will activate Microsoft Fabric's capabilities for our workspace. </p>
<p>To do this, follow these steps:</p>
<p>First, navigate to the capacity settings in the <a target="_blank" href="https://app.powerbi.com/home?experience=power-bi">admin portal</a>. The admin portal is where administrators control and manage the various Power BI features.</p>
<p><img src="https://lh7-us.googleusercontent.com/M5O2_Xb5h76ydZyy_VteTWpz2i3Nc_FiQoyZUXA_js69sWZidtAfzKMZ2-mJBgam4GqD0FXfft4fVFkBu_sw1rUCMIypcZHgWh49FgXO5xk-Q0dduYL3_7FGb5wLKrHoBPrL6-GU9nN3bdFrpsQT5wQ" alt="Image" width="344" height="777" loading="lazy">
<em>Admin Portal of Microsoft fabric</em></p>
<p>Then under the <strong>Tenant setting</strong> tab, look for <strong>Microsoft fabric</strong> tab.</p>
<p>Under that tab, enable the <strong>Users can create fabric items</strong> toggle to on. Once you've done that, select <strong>Apply</strong>.</p>
<p><img src="https://lh7-us.googleusercontent.com/yLMF0s789eNL7RW94Ax0Ssm-i9g1_wyOC7fgyPbql2DjNOgrrFVIMIKBrZMKs5aZA-br3MBgOrHu7g26moAG2kLI8JUE6WdJiRmC0wUK8Ak4h2TbDzt-t54LeOkBCqz2cTzpFrBT7q5MnvdgidTdGvo" alt="Image" width="1169" height="759" loading="lazy"></p>
<p>Now your environment will be set up and the various services should appear at the bottom left of your screen.</p>
<p><img src="https://lh7-us.googleusercontent.com/PKdkrIktTXMGw2O04yYa8-lkAiaUq6dZ_C4OCX3q6y3qlOl2jWr8hblLUwiFoWMDWyUPtF_aPAkfYKhXvaCOTjiU3ZlZAjrU3BJuAYx2QJfdKMRkQWalSVK7aRE0cqXepKM_oRUjvlSmYqCtL7tz1CE" alt="Image" width="442" height="424" loading="lazy">
<em>Now you can see all the services like Power BI, Data Factory, and so on.</em></p>
<h3 id="heading-ia"> </h3>
<p>How to Create a Workspace in Microsoft Fabric</p>
<p>We'll use a <a target="_blank" href="https://www.kaggle.com/datasets/vjchoudhary7/customer-segmentation-tutorial-in-python">mall customer segmentation dataset from Kaggle</a> for this demo. This data, as mentioned in Kaggle, was created for the purpose of learning customer segmentation concepts.</p>
<p>Let's talk a little bit about the dataset. Imagine you have a supermarket mall and each customer has a membership card. You also have a data catalog of each customer with basic information like their customer ID, age, gender, annual income and spending score. </p>
<p>Now we want to segment these customer into various groups so we can improve customer loyalty, understand the customers better, and more effectively target our marketing strategy. </p>
<p>To achieve this, we will use the spending score assigned to each customer to define their purchasing power.</p>
<p>To get started, you'll need to create a new workspace. You can do that by following these steps:</p>
<ol>
<li>Head to your <a target="_blank" href="https://app.powerbi.com/home?experience=power-bi&amp;clientSideAuth=0">Microsoft Fabric home page</a>.</li>
<li>Select <strong>workspaces</strong> and click on <strong>New Workspace</strong>.</li>
<li>Give your workspace a name – I'm calling mine FabricMall.</li>
<li>Click on <strong>Advanced</strong> to view the dropdown options and select <strong>Trial</strong> if you are making use of your Fabric trial.</li>
<li>Click <strong>Apply</strong>.</li>
</ol>
<p><img src="https://lh7-us.googleusercontent.com/KvydyWSwyknsCNEHahc8aNME1z4nxVsLYUlMmAf73ru4O1XoYz5YnrBAHml_uYJPajix6svZ_S5VlJn7Nv4GNvfxXNyHChZXF9ZFjOCDNs-QY0cVlZT3abtkukhjEs2Ik9HFq7NTg47_gHrrbquuppI" alt="Image" width="1600" height="719" loading="lazy">
<em>How to create a workspace in Microsoft fabric</em></p>
<p>The next thing you want to do is to create a Lakehouse for your data.</p>
<h3 id="heading-how-to-create-a-lakehouse-in-microsoft-fabric">How to Create a Lakehouse in Microsoft Fabric</h3>
<p>To create a Lakehouse, first click on <strong>New</strong> within your workspace. This will display a list of various tasks you can do within your workspace.</p>
<p>Then select <strong>More options</strong> and select <strong>Lakehouse</strong>. </p>
<p><img src="https://lh7-us.googleusercontent.com/_zF0EcAg_tSGHvdpZt41huS5OR346NZ7AGTlWioXKIKuT5D5s7h_SIjLH-Yia13tpTGeobE3VsxE5zS4vOoya5S4qdqHRGJJcnAZSNnNn2s_C_F2J2tjIYDoK1BP_omkv3HaEGvSfd6v-XiiBlKv-qQ" alt="Image" width="673" height="861" loading="lazy">
<em>Selecting Lakehouse under "More options"</em></p>
<p>Then give it a name, like <strong>FabricMallLake</strong>, and click on <strong>Open notebook</strong>.</p>
<p>Click on <strong>New notebook</strong> and <strong>Open</strong>. You can rename your notebook at the top left corner of your notebook. The notebook is similar to the Jupyter notebook experience.</p>
<p><img src="https://lh7-us.googleusercontent.com/hquyOMggUOEdoyLE53_a1dJBmvguAZegZ2atVLxiA8p3wpXHgLvZOZA3uj2SzMDnDXxhAV5D0rJE2gwv2yGw1_u2AotOEAgcP0Sqh5YtKiX4WBdENgGc5fb30MEou1RA0ejSSEnyucYvhdqej5UXEXs" alt="Image" width="1600" height="691" loading="lazy">
<em>Notebooks in Fabric</em></p>
<h3 id="heading-how-to-use-kaggle-api-data-in-microsoft-fabric">How to Use Kaggle API Data in Microsoft Fabric</h3>
<p>Notebooks allow us to write, visualize, and execute code. Within the Notebook, we will use Python to perform a customer segmentation on our data in Microsoft Fabric.</p>
<p>First, import Kaggle using the command below:</p>
<pre><code class="lang-python">!pip install Kaggle
</code></pre>
<p>Next, you'll need to import your operating system and connect to the Kaggle API.</p>
<pre><code class="lang-python"><span class="hljs-keyword">import</span> os
os.chdir(<span class="hljs-string">'/lakehouse/default/Files'</span>)
os.environ[<span class="hljs-string">'KAGGLE_USERNAME'</span>] = <span class="hljs-string">'bennyifeanyi'</span>
os.environ[<span class="hljs-string">'KAGGLE_KEY'</span>] = <span class="hljs-string">'050019167fbe0027359cdb4b5eea50fe'</span>
<span class="hljs-keyword">from</span> kaggle.api.kaggle_api_extended <span class="hljs-keyword">import</span> KaggleApi
api = KaggleApi()
api.authenticate()
api.dataset_download_file(<span class="hljs-string">'vjchoudhary7/customer-segmentation-tutorial-in-python'</span>, <span class="hljs-string">'Mall_Customers.csv'</span>)
</code></pre>
<p>In the code above, <code>os.chdir('/lakehouse/default/Files')</code> represents our File API path. Also remember to replace the <a target="_blank" href="https://www.kaggle.com/settings">username and API Key</a> with your own.  </p>
<p>Now import Pandas. This will allow you to read your file.</p>
<pre><code class="lang-python"><span class="hljs-keyword">import</span> pandas <span class="hljs-keyword">as</span> pd
df = pd.read_csv(<span class="hljs-string">"/lakehouse/default/"</span> + <span class="hljs-string">"Files/Mall_Customers.csv"</span>)
df.head()
</code></pre>
<p>But before we start segmenting our customers, let's transform our data by exploring the data wrangler.</p>
<h3 id="heading-how-to-use-the-data-wrangler-in-microsoft-fabric">How to Use the Data Wrangler in Microsoft Fabric</h3>
<p>One of the most exciting things about this notebook is that you can perform data cleaning tasks without writing code using the Data Wrangler.</p>
<p>To do that, click on <strong>Data</strong> on the ribbon and select <strong>Transform DataFrame in Data Wrangler</strong>. </p>
<p>We will perform the following transformations:</p>
<ul>
<li>We will convert the gender column to lowercase.</li>
<li>We will also rename the columns with special characters like the dollar sign, brackets, and a dash. This is because I noticed Fabric finds it hard to handle these characters at the moment.</li>
</ul>
<p>To do these transformations, follow these steps:</p>
<p>Under the <strong>Operation</strong> tab, select <strong>Convert text to lowercase</strong>.</p>
<p>Pick the column – Gender in this example – and select <strong>Apply</strong>. This will convert your Gender column to lowercase and automatically generate the codes.</p>
<p><img src="https://lh7-us.googleusercontent.com/-QkNWJszDVHAMtm282FTLr-_NekndORMvaR45tqhxDIg7rMW7Rr2FfMTEOW2kb_ZlnmNxQ50MfWB4hma-lbMcNr6Du1BmFd-f7ehG-4-sSJbdhf7WmV0CrvCZGnE92w8qddCCyHaaxM6HAE_yvhYgDM" alt="Image" width="1600" height="755" loading="lazy">
<em>Data wrangler: Formatting text</em></p>
<p>Similarly, under the <strong>schema</strong> tab, select rename columns.</p>
<p>Rename <strong>Annual Income (k$)</strong> to <strong>AnnualIncome</strong>, and <strong>Spending Score (1-100)</strong> to <strong>SpendingScore</strong>.</p>
<p>Once you’re done with the transformation, click <strong>Add code to notebook</strong>.</p>
<p><img src="https://lh7-us.googleusercontent.com/vtvL7X_ll8Nh2mpc7bW01cqy-XvMeiy7whyrJtQdbc0QTz3VQ-qYV3-uywa4QVI2DpfvLPXudHy-a4bTFAOt0Fp2d0ac6lUVp7L0zT38m6ImNQrFTtKp8WtFPZaVjEjCNMrtSph7fhAZSw7o_DQvWe0" alt="Image" width="1501" height="807" loading="lazy">
<em>Data wrangler: Rename column</em></p>
<p>Back in the notebook, we can visualize our data using the code below:</p>
<pre><code class="lang-python">sparkdf = spark.createDataFrame(df_clean)
display(sparkdf)
</code></pre>
<p>Within the chart element created, select <strong>Customize chart</strong>. Pick the columns you want and select <strong>Apply</strong>.</p>
<p><img src="https://lh7-us.googleusercontent.com/WZoVr74bKT59da-YBwDishooHH1rqufkWA_jN-zr2eDK237rrKTXZybjZ-U5iWU7qnPOFyPnHKA0SkjIuC_ADk_X3Uh35sSAFMz254_FVKcc4IQGxBPQwNsP3Z_d-0uPHJxWxqJpoHdoJP_KOjQw6jo" alt="Image" width="1579" height="700" loading="lazy">
<em>Charts in Data Wrangler</em></p>
<p>Once that's done, we can save the data in the Lakehouse using this code below:</p>
<pre><code class="lang-python">sparkdf.write.format(<span class="hljs-string">"delta"</span>).mode(<span class="hljs-string">"overwrite"</span>).saveAsTable(<span class="hljs-string">"malldatadf"</span>)
</code></pre>
<p><img src="https://lh7-us.googleusercontent.com/boKGK5-xUaWccqNy76XjSXDd0Fdkrg2JOyqYiDTq51JOog-a_KMWsfLHTskC5iySI8nBuHjiWsDhj1ZVwLG5TxHbRciWTjBJIisKsvQJLsqEq4-UnFVfHBL1ngWMYMdZ5nheYw9pqwmApxaoL8WIMRE" alt="Image" width="1600" height="617" loading="lazy">
<em>Saving data in Lakehouse</em></p>
<h3 id="heading-how-to-perform-customer-segmentation-in-microsoft-fabric">How to Perform Customer Segmentation in Microsoft Fabric</h3>
<p>For our customer segmentation, we will use the KMeans clustering algorithm to segment the customers based on their annual income and spending score. </p>
<p>K-means clustering is an unsupervised machine learning algorithm. It groups similar data points in your data based on underlying observations, similarities, and input vectors. </p>
<p>We will do this by importing our libraries, applying our K-means by training the K-Means clustering model, and visualizing the clusters of customers based on their annual income and spending score. </p>
<p>We will also include and show the centroids of each cluster, providing insights into the distribution of customers in the dataset. </p>
<p>The centroids here refers to the center points of the clusters found by our algorithm. This is calculated as the average of all the data points in that cluster. When we visualize the clusters, the centroid will be represented with a distinct symbol or color.</p>
<p>Run this code to achieve this:</p>
<pre><code class="lang-python"><span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np
<span class="hljs-keyword">import</span> seaborn <span class="hljs-keyword">as</span> sns
<span class="hljs-keyword">import</span> matplotlib.pyplot <span class="hljs-keyword">as</span> plt
<span class="hljs-keyword">from</span> sklearn.cluster <span class="hljs-keyword">import</span> KMeans
<span class="hljs-keyword">from</span> sklearn.preprocessing <span class="hljs-keyword">import</span> StandardScaler
<span class="hljs-keyword">from</span> sklearn.preprocessing <span class="hljs-keyword">import</span> MinMaxScaler
X = df_clean[[<span class="hljs-string">'AnnualIncome'</span>, <span class="hljs-string">'SpendingScore'</span>]]
<span class="hljs-comment"># Feature normalization</span>
scaler = MinMaxScaler()
X_scaled = scaler.fit_transform(X)
kmeans = KMeans(n_clusters=<span class="hljs-number">5</span>, init=<span class="hljs-string">'k-means++'</span>, random_state=<span class="hljs-number">42</span>)
kmeans.fit(X_scaled)
plt.figure(figsize=(<span class="hljs-number">10</span>, <span class="hljs-number">8</span>))
<span class="hljs-keyword">for</span> cluster_label <span class="hljs-keyword">in</span> range(<span class="hljs-number">5</span>):  <span class="hljs-comment"># Loop through each cluster label</span>
cluster_points = X[kmeans.labels_ == cluster_label]
centroid = cluster_points.mean(axis=<span class="hljs-number">0</span>)  <span class="hljs-comment"># Calculate the centroid as the mean position of the data points</span>
plt.scatter(cluster_points[<span class="hljs-string">'AnnualIncome'</span>], cluster_points[<span class="hljs-string">'SpendingScore'</span>],
s=<span class="hljs-number">50</span>, label=<span class="hljs-string">f'Cluster <span class="hljs-subst">{cluster_label + <span class="hljs-number">1</span>}</span>'</span>)  <span class="hljs-comment"># Plot points for the current cluster</span>
plt.scatter(centroid[<span class="hljs-number">0</span>], centroid[<span class="hljs-number">1</span>], s=<span class="hljs-number">300</span>, c=<span class="hljs-string">'black'</span>, marker=<span class="hljs-string">'*'</span>, label=<span class="hljs-string">f'Centroid <span class="hljs-subst">{cluster_label + <span class="hljs-number">1</span>}</span>'</span>)  <span class="hljs-comment"># Plot the centroid</span>
plt.title(<span class="hljs-string">'Clusters of Customers'</span>)
plt.xlabel(<span class="hljs-string">'Annual Income (k$)'</span>)
plt.ylabel(<span class="hljs-string">'Spending Score (1-100)'</span>)
plt.legend()
plt.show()
</code></pre>
<p>Here's the output:</p>
<p><img src="https://lh7-us.googleusercontent.com/lsIdbv7j_QbsmChgxFgs-X0QQEguqGZS_Hsvrj1kB55hIUsuTt5kGP5denL28jszo_HCjTe9NB-NbYfS2rsXJgw1LnHH6c7Z7E0cJe1vdW5pe3s9o4F2AebF2l6MB3M_XHtEYIzuzGSmFGaPFYbfj4w" alt="Image" width="1600" height="661" loading="lazy">
<em>Performing Customer Segmentation in Microsoft Fabric</em></p>
<p>The result of our analysis shows that our customers can be grouped into 5 clusters:</p>
<ul>
<li>Cluster 1 (Purple) are low income earners with a low spending score.</li>
<li>Cluster 2 (Blue) are low income earners with a high spending score.</li>
<li>Cluster 3 (Red) are average income earning customers with significant spending scores.</li>
<li>Cluster 4 (Orange) are high income customers who do not spend much at the mall. They’re probably not satisfied with the services rendered.</li>
<li>Cluster 5 (Green) are high income customers with a high spending score.</li>
</ul>
<p>We can also save our prediction as a new dataset using this code:</p>
<pre><code class="lang-python"><span class="hljs-comment"># Create a new DataFrame to store the clustering results</span>
cluster_df = pd.DataFrame(data=X, columns=[<span class="hljs-string">'AnnualIncome'</span>, <span class="hljs-string">'SpendingScore'</span>])
cluster_df[<span class="hljs-string">'Cluster'</span>] = cluster_label
sparkclusterdf = spark.createDataFrame(cluster_df)
sparkclusterdf.write.format(<span class="hljs-string">"delta"</span>).mode(<span class="hljs-string">"overwrite"</span>).saveAsTable(<span class="hljs-string">"clusterdatadf"</span>)
</code></pre>
<p><img src="https://lh7-us.googleusercontent.com/vMJYBX_nbjwPdODAlVKfWp-KWvqRD6BW-pPg4XAZ8UVgSMkaI4-tDRQZqlA38Eg5iVpvP-f_cUI9vXL6dxmUYJl-kJ_t46lQfsXytQGGAW1iHSGad8x7KwEqxDBeP2effQ-LME1PX5qE3-7NBUoa9Yg" alt="Image" width="1600" height="647" loading="lazy">
<em>Customer segementation prediction</em></p>
<p>Want to take a look at the notebook? You can download it from <a target="_blank" href="https://github.com/Bennykillua/Project/tree/main/CustomerSegmentationMicrosoftFabric">my GitHub</a>.</p>
<h3 id="heading-how-to-visualize-lakehouse-data-in-power-bi">How to Visualize Lakehouse Data in Power BI</h3>
<p>Now we can decide to visualize our data on a dashboard within Fabric.</p>
<p>Head back to the FabricMall workspace and select the <strong>semantic model type</strong> of the FabricMallLake Lakehouse.</p>
<p><img src="https://lh7-us.googleusercontent.com/YO0SWvhNJEdz2o3a85rhOf8CHorcX50o_Fu3sqJWdGP-P8kO8t1CD194a7JB9Tx3LxyFjMvjE0ek9CrRBSMKyXGy2vrx0hPQ9BZofrlI9BRw3o4nqDCegmZ1GCyi2pDMk4mfKuCvFycUW6f0kwjYnxQ" alt="Image" width="1301" height="640" loading="lazy">
<em>semantic model type of the FabricMallLake LakeHouse</em></p>
<p>Then select <strong>Manage default semantic model</strong>.</p>
<p><img src="https://lh7-us.googleusercontent.com/j5k-aWOHKXMKrkfygcD7HBIUDONorZcnpbH0j2uNbiL1rLZ8sdhOIscIKnTLZXwFBGEDNp30v3oYi0vPsG-t_SawMcVcp1kd7PSI81iM-ZOm1IGn72KFs5hDPmFbJ_UAF4Cr2wiEphaM93EWgiVfXug" alt="Image" width="1600" height="650" loading="lazy">
<em>Manage default semantic model In Microsoft Fabric</em></p>
<p>Pick your dataset, click <strong>Confirm</strong>, and then select <strong>New Report</strong>. </p>
<p>Let's visualize the average age in our data. To do this, click on the card visual and drag the age into this card. This will automatically create a visual showing the average age in your dataset. </p>
<p><img src="https://lh7-us.googleusercontent.com/eh28PLD0HCw2m2fWIbVhIrL78TLRP0hqF5aSDbEcE6_hzFaZaWA9c_AX5_u_w6yG49ovcvBVWY_Og4nQYqDnUCeIEe73o6LAgyrH0pLv0Gy1eMxxmhrV2KbmIDPuQhgPsimL_Drnxkq6wlE-OrG0CFA" alt="Image" width="1600" height="671" loading="lazy">
<em>Power BI service in Microsoft Fabric</em></p>
<p>Just like in <a target="_blank" href="https://www.freecodecamp.org/news/teach-yourself-data-analytics-in-30-days/#:~:text=Enterprise%20strength%20tools%20like%20Tableau%20Splunk%2C%20or%20Microsoft's%20Power%20BI&amp;text=You%20can%20download%20Jupiter%20to%20your%20PC%20or%20a%20private%20server%20and%20access%20the">Power BI Desktop</a>, you can create your measure, build your report, and publish your dashboard. You can learn more about how to create visuals in Power BI using this free <a target="_blank" href="https://www.youtube.com/watch?v=PSNXoAs2FtQ">freeCodeCamp YouTube data analysis video</a>.</p>
<p>Alternatively, you can open Power BI Desktop, and connect to your Lakehouses from Onelake data hub.</p>
<p><img src="https://lh7-us.googleusercontent.com/Na-xm9ThvGM6rkljbdDHD_ZUzekJ88mzCRQSoKOW7bCNfgmB_dkusJjoOrBfyIam-Smnvm_2p08G-25MVx_IsJpvUxnCYZab4NlKCCystqkn7kdPN56QLxvJ0ikCLmca4w4Y828dk8lUE2tqakpDWr4" alt="Image" width="1536" height="992" loading="lazy">
<em>Connect to your Lakehouse in Power BI</em></p>
<h2 id="heading-where-can-i-learn-more-about-microsoft-fabric">Where Can I Learn More about Microsoft Fabric?</h2>
<p>Though Microsoft Fabric is a pretty new data platform, I hope you can tell that this tool will help you ease the way you and your team consume, analyze, and get insight from your data.</p>
<p>To learn more you can start with the <a target="_blank" href="https://www.microsoft.com/en-us/microsoft-fabric/getting-started">fabric official documentation</a> or any helpful YouTube tutorial like <a target="_blank" href="https://www.youtube.com/playlist?list=PLUeJI2NOafNvaNor3qUHw1gyFuz_K1Rtt">Francis’s Fabric course.</a> I would also advise you to start with freeCodeCamp's Fabric publication tags if you want a compilation of resources.</p>
<p>Lastly, if you’re new to data analysis, start your journey today with <a target="_blank" href="https://www.youtube.com/watch?v=PSNXoAs2FtQ">freeCodeCamp’s Data Analyst Bootcamp for Beginners on YouTube</a>. It covers everything from SQL, Tableau, Power BI, and Python to Excel, Pandas, and real-life projects building.  </p>
<p>If you enjoyed reading this article and/or have any questions and want to connect, you can find me on <a target="_blank" href="https://www.linkedin.com/in/ifeanyi-iheagwara/">LinkedIn</a>, <a target="_blank" href="https://twitter.com/Bennykillua">Twitter</a> and do check out my articles on <a target="_blank" href="https://www.freecodecamp.org/news/author/benny/">freeCodeCamp</a>.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ Microsoft Excel Tutorial – How to Create Formulas and Functions ]]>
                </title>
                <description>
                    <![CDATA[ Spreadsheets aren't merely for arranging data into rows and columns. Most of the time, you use them for data analysis as well.  Microsoft Excel is one of the most widely used spreadsheet applications, especially in finance and accounting. This is par... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-create-microsoft-excel-formulas-and-functions/</link>
                <guid isPermaLink="false">66ba5bc3e530197d3818e191</guid>
                
                    <category>
                        <![CDATA[ excel ]]>
                    </category>
                
                    <category>
                        <![CDATA[ spreadsheets ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Benny Ifeanyi Iheagwara ]]>
                </dc:creator>
                <pubDate>Thu, 08 Sep 2022 15:17:10 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2022/09/Green-Orange-and-Brown-Collage-Math-Quiz-Presentation.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Spreadsheets aren't merely for arranging data into rows and columns. Most of the time, you use them for data analysis as well. </p>
<p>Microsoft Excel is one of the most widely used spreadsheet applications, especially in finance and accounting. This is partly because of its easy UI and unmatched depth of functions.</p>
<p>In this article, you will learn:</p>
<ul>
<li>What Excel formulas are</li>
<li>How to write a formula in Excel</li>
<li>What Excel functions are</li>
<li>How to work with an Excel function</li>
<li>Lastly, we'll take a look at dynamic Excel functions.</li>
</ul>
<h1 id="heading-what-do-i-need-to-install-on-my-computer-to-follow-this-article">What do I need to install on my computer to follow this article?</h1>
<p>To follow along, you will need to have Microsoft Excel installed on your computer. We’ll use a Windows computer for this article.</p>
<h1 id="heading-how-can-i-install-microsoft-excel-on-my-computer">How can I install Microsoft Excel on my computer?</h1>
<p>Follow these steps to install Microsoft Excel on your Windows computer:</p>
<ol>
<li>Sign in to <a target="_blank" href="https://www.office.com/">www.office.com</a> if you’re not already signed in.</li>
<li>Sign in with the account associated with your <a target="_blank" href="https://www.microsoft.com/en/microsoft-365?ocid=oo_support_mix_marvel_ups_support_railbanner_1000852&amp;rtc=1">Microsoft 365</a> subscription. You can also try out <a target="_blank" href="https://signup.live.com/signup?mkt=en-US&amp;uiflavor=web&amp;lw=1&amp;fl=easi2&amp;client_id=4345a7b9-9a63-4910-a426-35363201d503&amp;wreply=https%3A%2F%2Fwww.office.com%2F%3Fauth%3D1%26from%3DOdotComFreeSignup">Office for free</a> as well.</li>
<li>Once signed in, select “Install Office” from the Office home page. This will automatically download Microsoft Office onto your Windows computer.</li>
<li>Run the installer to set up Microsoft Office and select "Close" once you're done.</li>
<li>Once done, select the “Start” button (located at the lower-left corner of your screen) and type “Microsoft Excel.”</li>
<li>Click on Microsoft Excel to open it.</li>
<li>Accept the license agreement, and let's get started.</li>
</ol>
<h1 id="heading-what-are-excel-formulas">What are Excel Formulas?</h1>
<p>An Excel formula is an expression that carries out an operation based on the value of a cell or range of cells. You can use an Excel formula to:</p>
<ul>
<li>Perform simple mathematical operations such as addition or subtraction.</li>
<li>Perform a simple operation like joining categorical data.</li>
</ul>
<p>It's important to understand two things: Excel formulas always begin with the equals "=" sign and they can return an error if not properly executed.</p>
<h1 id="heading-what-operators-are-used-in-excel-formulas">What Operators Are Used in Excel Formulas?</h1>
<p>There are four different types of operators in Excel—arithmetic, comparison, text concatenation, and reference. But for most formulas, you’ll typically use these three:</p>
<h3 id="heading-arithmetic-operators">Arithmetic operators</h3>
<table><colgroup><col><col></colgroup><tbody><tr><td><p><span>+</span></p></td><td><p><span>Addition</span></p></td></tr><tr><td><p><span>-</span></p></td><td><p><span>Subtraction</span></p></td></tr><tr><td><p><span>/</span></p></td><td><p><span>Division</span></p></td></tr><tr><td><p><span>*</span></p></td><td><p><span>Multiplication</span></p></td></tr><tr><td><p><span>^</span></p></td><td><p><span>Exponentiation</span></p></td></tr></tbody></table>

<h3 id="heading-comparison-operators">Comparison operators</h3>
<table><colgroup><col><col></colgroup><tbody><tr><td><p><span>=</span></p></td><td><p><span>Equal to</span></p></td></tr><tr><td><p><span>&gt;</span></p></td><td><p><span>Greater than</span></p></td></tr><tr><td><p><span>&lt;</span></p></td><td><p><span>Less than</span></p></td></tr><tr><td><p><span>&gt;=</span></p></td><td><p><span>Greater than or equal to</span></p></td></tr><tr><td><p><span>&lt;=</span></p></td><td><p><span>Less than or equal to</span></p></td></tr><tr><td><p><span>&lt;&gt;</span></p></td><td><p><span>Not equal to</span></p></td></tr></tbody></table>

<h3 id="heading-text-concatenation">Text concatenation</h3>
<p>Here you have just the ampersand “&amp;” sign for joining text.</p>
<h1 id="heading-how-can-i-create-an-excel-formula">How Can I Create an Excel Formula?</h1>
<p>Let's take a simple scenario using one of the arithmetic operators.</p>
<p>In math, to add up two numbers, let's say 20 and 30, you will calculate this by writing: 20 + 30 = </p>
<p>And this will give you 50.</p>
<p>In Excel, here is how it goes:</p>
<ol>
<li>First, open a blank Excel worksheet.</li>
<li>In cell A1, type 20.</li>
<li>In cell A2, type 30.</li>
<li>To add it up, type in = 20 + 30 in cell A3.</li>
</ol>
<p><img src="https://lh5.googleusercontent.com/ahFv4-tCq-5p6B9wWJwrfv-0glehpnu9gMnAw34pwCUh9hUVyw3p5aOu5ejIAnCPBDtw6g_CTOOWaEtap1ph2XP5nL9TkxVb2E5iV80tp6Tm73968jE3kyCPKaMkrVYpw1Mn4rYBxXMSrU5CzEkSlxNhBp-KiZLfEtDAOagAzGHa6RWO5yLaZsyevQ" alt="Image" width="600" height="400" loading="lazy">
<em>How can I create an Excel formula?</em></p>
<ol start="5">
<li>Then, press ENTER on your keyboard. Excel will instantly calculate this and return 50.</li>
</ol>
<p><img src="https://lh6.googleusercontent.com/XGXatK9hD_imhCrF3wQ-NuzlOzCgW0TCysQ0vwtk-Xz8Wu-W5ZxIKf65DBbc0i5H2_ubVC4rBoiyVauMcOWdapOwqGwhANyNKhwS_us0CTFMBP76q2wP3HGksmsWvb8ebB6cLG_3RzWSp2vie7woGbTZTuMmaPsnwa5oFoP8gFNf6RwbJa4O-hnVzQ" alt="Image" width="600" height="400" loading="lazy">
<em>How can I create an Excel formula? Adding numbers in Excel</em></p>
<p>I mentioned earlier that every formula begins with the equal "=" sign. That's what I meant. To write a formula, you type the equal to sign followed by the numeric values. This also applies to cases of subtraction, division, multiplication, and exponentiation. </p>
<p>Let's take another simple scenario using one of the comparison operators. Assume we want to find out if 30 is greater than 40.</p>
<p>In Excel, here is how we would do it:</p>
<ol>
<li>Type in =30&gt;40</li>
<li>Press ENTER.</li>
</ol>
<p><img src="https://lh6.googleusercontent.com/j7NqF7FlQbtnSWU_QiE2pHtmsadofCUgJHkXKTEEp2miFXV24QjJMMyZrP-sVibNuM__jgW1szMEQjuFtz4gb9ZbOm6n5UtWtGNktWd3iOEcnbTFH4_4GftYs_FLySTkeWhA51MujOKvZGAkdYN96hzyGb86Na_dKhawPQFXRNtP7jI87Azo1FZ1qA" alt="Image" width="600" height="400" loading="lazy">
<em>How can I create an Excel formula? Comparison operators</em></p>
<ol start="3">
<li>This will return a FALSE because 30 isn't greater than 40. Excel uses TRUE and FALSE for logical statements, the same way we human says yes and no.</li>
</ol>
<p><img src="https://lh5.googleusercontent.com/rmJNrTzMCS3Qg0nIk-1DqURQuqfO2qF-0eqiF4RyAsM9lPDGtVyDpzsJryzN-7BXrv3qGbIhRjw2NGNKHiMVaHlWwnqVWigvlu35dqTUgHaxGshud8n3bdsnwrJ9cXPMLASLQDMKoAJqRjivuqgA_WQpYZaUMDq4T41LMJzgivLeqd5LN2_zrsmTrA" alt="Image" width="600" height="400" loading="lazy">
<em>How can I create an Excel formula? Comparison operators</em></p>
<p>Lastly, let's take another simple scenario using the text concatenation operator – the ampersand “&amp;” sign. This works with your string data types and you use it to join text.</p>
<p>Assume we have "Welcome", "To", and "FreeCodeCamp" all in different cells—A1, A2, and A3—of your worksheet. We would type =A1&amp;” “&amp;A2&amp;” “&amp;A3 to join them.</p>
<p>The space in quotes “ “ represents that we want a space between our words.</p>
<p><img src="https://lh6.googleusercontent.com/_NuH8HoSTLRA4zTSGaCkcCwLKhjZVYy885wThXg_NgwYsyIDEk_6APoloy2wujJUNZUkXsBTFDr-dmO_x3B_4WU0XQUaBJGiNz6gTlPC3lqR2U5utRsK9S3R9yxoRi4U9N1zvH92LMW-F97cn5hx1_k09du0tYxFERxtg5w5Zl8M4Bw_HSyF8maq6w" alt="Image" width="600" height="400" loading="lazy">
<em>How can I create an Excel formula using the ampersand “&amp;” sign</em></p>
<p>Another tip: the formula bar shows the formula used to generate a value.</p>
<h1 id="heading-what-are-excel-functions">What Are Excel Functions?</h1>
<p>Excel functions are predefined inbuilt formulas that perform mathematical, statistical, and logical calculations and operations using your values and arguments.</p>
<p>For Excel functions, you should know that:</p>
<ul>
<li>They’re formulas, so yeah, they start with the equal "=" sign as well.</li>
<li>The order is very important.</li>
</ul>
<p>There are over 500 functions available. You can find all available Excel functions on the Formulas tab on the Ribbon.</p>
<p><img src="https://lh5.googleusercontent.com/GL6J_F_ao0U-lmLQs8CCZHrjxGZz5l_zF9b7EAn6lirKVRx9YZ86PCw6UTrCFBFhPDaiEUBSpLA8fOZcj43CW7oDWYlcxjEHXMXe5cSphegI2HpdfjrJxoXaWcP8wCEK9gAV30rqE89Gd08y1pj5vI5JGSCfDgdUg8lxu2MT9S-KgnFahn5o-H2x7A" alt="Image" width="600" height="400" loading="lazy">
<em>All available Excel formulas and functions</em></p>
<p>But why use a function when you can just write a formula?</p>
<p>Here are some benefits of Excel functions.</p>
<ul>
<li>To improve productivity and effectiveness.</li>
<li>To simplify complex calculations.</li>
<li>To automate your work.</li>
<li>To quickly visualize data.</li>
</ul>
<h2 id="heading-what-makes-up-excel-functions">What Makes Up Excel Functions?</h2>
<p>Unlike formulas, Excel functions are made up of a structure with arguments you need to pass.</p>
<p>Every function:</p>
<ul>
<li>Starts with the equals "=" sign</li>
<li>Has a name. Some examples are VLOOKUP, SUM, UNIQUE, and XLOOKUP.</li>
<li>Requires arguments which are separated by commas. You should know that semicolons are used as separators in countries like Spain, France, Italy, Netherlands, and Germany. You can, however, change this via the Excel setting.</li>
<li>Argument with the square brackets [] are optional</li>
<li>Has an opening and closing parenthesis.</li>
<li>Has an argument tooltip which shows you what you should pass.</li>
</ul>
<p>There are some exceptions. For example,</p>
<ul>
<li>The DATEDIF doesn't show in Excel because it is not a standard function and gives incorrect results in a few circumstances. However, here is the syntax: </li>
</ul>
<p><code>DATEDIF(birthdate, TODAY(), "y")</code></p>
<ul>
<li>Functions like PI(), RAND(), NOW(), TODAY() require no argument.</li>
</ul>
<h1 id="heading-how-to-use-excel-functions">How to Use Excel Functions</h1>
<p>Let's look at a few functions:</p>
<h3 id="heading-how-to-use-the-sum-function-in-excel">How to Use the <code>SUM()</code> Function in Excel</h3>
<p>According to the documentation, the SUM function adds values. Here is the syntax:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/09/image-315.png" alt="Image" width="600" height="400" loading="lazy">
<em>Excel Sum Syntax</em></p>
<p>Let's assume that we have a line of numbers from 1 to 10 and we want to add it up. To achieve this, we will just type =SUM(A1:A10). The A1:A10 simply returns an array of number that are situated on cell A1 to A10 which are A1, A2, and A3 up through A10.</p>
<p><img src="https://lh3.googleusercontent.com/oj-2CwOiYRuzMhsH6oyy8zMFUCw9EpTPQWtLhkUbsbigzk-U6RG_dDG_aVeazYkgIQmuil80wG0N6_t3yk9oqF3EKjdSoREj8c-PqACBgOkZX763fMyM4oLKnGVharikQAFt0SNEvkxO1bnN67LQs3LLfQ-LW2R37IFVJGXz7KvJ1Wu_S7imz-0YsA" alt="Image" width="600" height="400" loading="lazy">
<em>How to use Sum in Excel</em></p>
<p>Since the second argument is optional, that means a sum(A10) will return a value. In our case, it will return just 10 since A10 has the value 10 in it. Give it a try.</p>
<p>If you were writing this using the addition operator, you would have written:</p>
<p>=1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 </p>
<p>or </p>
<p>=A1 + A2 + A3 + A4 + A5 + A6 + A7 + A8 + A9 + A10 </p>
<p>This doesn't look very productive or efficient.</p>
<h3 id="heading-how-to-use-the-today-function-in-excel">How to Use the <code>TODAY()</code> Function in Excel</h3>
<p>According to the documentation, the TODAY function displays the current date on your worksheet. It also requires no argument. Here is the syntax:</p>
<p><img src="https://lh3.googleusercontent.com/o0zz_IZW5soeg7kcBLmaruiuCHlVhyR4C3_-D0lDhtXV0xDZU4JnapR9q_QbyXOdsSN_n8Ko0owSMITVXWbOjZml2GATMUBx4h9QcNpQsbz6B1BsDbxvoK2N-cuyw5I7OcwyyAJI8BbnPXiU2pVAYmQ26SnXHrWQt2DFsiWi5l6oo_U4dEo6cruImA" alt="Image" width="600" height="400" loading="lazy">
<em>How to use Today() in Excel</em></p>
<p>Excel displays the current date automatically according to your computer's date and time setting. The same goes for the NOW() function, which displays the current date and time.</p>
<h3 id="heading-how-to-use-the-concatenate-function-in-excel">How to Use the <code>CONCATENATE()</code> Function in Excel</h3>
<p>Let’s look at a text function. You use CONCATENATE to join two or more text strings into one string together.</p>
<p>Here is the syntax:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/09/image-316.png" alt="Image" width="600" height="400" loading="lazy">
<em>Excel CONCATENATE() Syntax</em></p>
<p>Let's assume we want to join “This is” with “freeCodeCamp” – but in your cell, you have just "freeCodeCamp."</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/09/image-320.png" alt="Image" width="600" height="400" loading="lazy">
<em>freeCodeCamp Excel</em></p>
<p>If you’re going to write a string inside a formula, you must write it inside quotes like this “ “. </p>
<p>Why?</p>
<p>This way, Excel wouldnt think you're trying to write another function.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/09/image-319.png" alt="Image" width="600" height="400" loading="lazy">
<em>How to use Excel CONCATENATE function</em></p>
<p>This will return the phrase “This is freeCodeCamp”</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/09/image-321.png" alt="Image" width="600" height="400" loading="lazy">
<em>How to use CONCATENATE() in Excel</em></p>
<h3 id="heading-how-to-use-the-vlookup-function-in-excel">How to Use the <code>VLOOKUP()</code> Function in Excel</h3>
<p>This is one of Excel’s most interesting and commonly used formulas or functions. You use it to find a value in a table or range by row.</p>
<p>Here is a scenario:</p>
<p>We have a simple table that shows various films along with their genre, lead studio, audience score %, profitability, rotten tomatoes %, worldwide gross and year. I would use just the first 10 rows of the sample data from this <a target="_blank" href="https://gist.github.com/tiangechen/b68782efa49a16edaf07dc2cdaa855ea">GitHub Gist</a>.</p>
<p><img src="https://lh5.googleusercontent.com/T12acvhR4WeGpmxjG8Ye9-nif_k8r-trYb3Zacz9PZjxRDZJOQd1weeIx06Soa-QRsriVCuaGrJ2B_-6klJcxyuRKh7cmoIPre-cbHecnxvooo6AEYd5pgc_Dz2keINjCm-yF3Vw1HtcQTfzMK938gUK5Ybks72moTZEGuPmnHVHS2-yHv38hRvArg" alt="Image" width="600" height="400" loading="lazy">
<em>Flim dataset</em></p>
<p>I want that, whenever I type in a movie in the yellow cell, the year should get displayed in the green cell. Let's use VLOOKUP to find it.</p>
<p>This is the VLOOKUP syntax:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/09/image-317.png" alt="Image" width="600" height="400" loading="lazy">
<em>Excel Vlookup Syntax</em></p>
<p>Besides writing your formulas in the cell, you can also write them using the Excel Insert Function (fx) button, which is close to the formula bar.</p>
<p>Let's try this.</p>
<ol>
<li>Write <code>=Vlookup(</code> on the green cell.</li>
<li>Click on fx. A dialogue box will pop up showing all the arguments this formula needs.</li>
<li>Input the value for each argument.</li>
<li>Lookup_value (required argument): This is what you want to find. In our case, that is the movie “Youth in Revolt” which is in cell B1.</li>
<li>Table_array (required argument): This is just asking you for the table that contains the data. You give it the entire table, which in our case is A4:H13</li>
<li>Col_index_num (required argument): This is asking you for the column number of the table you gave. In our case, we want the year. This is in column 8.</li>
<li><p>Range_lookup (optional argument): Lastly, we pick if we want an approximate match (TRUE) or an exact match (FALSE). </p>
<ul>
<li><p>TRUE means approximate match, so it returns the closest or an estimate.</p>
</li>
<li><p>FALSE means exact match, so it returns an error if it's not found.</p>
</li>
</ul>
</li>
<li><p>We would go for the FALSE because we want the exact match.</p>
</li>
</ol>
<p><img src="https://lh6.googleusercontent.com/T-VtgAKve9lXEP8VA5FATji23YJveuZJfqWEnde330eLDw0gJj2hn1Qol5R1fVqs9aFYPoxFZ9Y5XLwth6MHWgYH55i0Llz-gS8m2_r7aEViaDD_3_Gpow5rWATdGtCBVlPTolM-9zZ2hono6lsBiN-l_DM7pVjLzk7oOZ-GYO8unxTQF7unpzA5MA" alt="Image" width="600" height="400" loading="lazy">
<em>How to use VLOOKUP() in Excel</em></p>
<ol start="9">
<li>Click on "OK." Excel will return 2010. </li>
</ol>
<p>However, you can write this in the cell by typing in <code>=VLOOKUP(B1,A4:H13,8,FALSE)</code> in your cell.</p>
<p><img src="https://lh3.googleusercontent.com/fhQrWy2DvFXRtscCz_H-DbZE73claukadh-KwtU5XGuxmZWDwtDlo60aM7cqBS3iPpayxfB3DH6NeFFH2j19l2M3QXM7RCUlYrGHRUlxcFAmEUylwj4g1b8k00lYx_8FWrEQl4cJyxmhoUPLlxJuALoUtO5F06SQl1_0nWusaza0nWFwZmO4T-3qGA" alt="Image" width="600" height="400" loading="lazy">
<em>How to use VLOOKUP() in Excel</em></p>
<h1 id="heading-tips-and-rules-when-writing-excel-functions">Tips and Rules When Writing Excel Functions</h1>
<p>When writing our function, Excel provides some formula tips.</p>
<ol>
<li>The Argument tooltip doesn't leave until you close the last parenthesis.</li>
<li>The formula bar shows your formula.</li>
<li>The argument you are currently writing is always dark. Take a look at the lookup_value in the image below.</li>
<li>The square brackets [] tell you it is optional.</li>
<li>Lastly, the colour code – our B1 is in blue, and cell B1 is in blue to guide us on what cell or table was picked. The same thing will happen to A4:H13 when we pick it as our table_array argument.  </li>
</ol>
<p><img src="https://lh4.googleusercontent.com/DVOp6zoa3z8cC01iE0iW01CcMv3ceE3WId7qu-2peocY8HkJf3ltmXHfAgHjj9Sj-7w-NS0DugruBR8FTCTRW77AFLRmdwM_UY83pXcFv3M6FHZBHFpWXy6B02ocko1NtC15GpHenEzBjU2w13i5SorlHU_6FdfA12iycyevjQhgnu6Mr78_CwkRSw" alt="Image" width="600" height="400" loading="lazy">
<em>Vlookup and Excel formula bar</em></p>
<h1 id="heading-how-to-work-with-nested-functions-in-excel">How to Work with Nested Functions in Excel</h1>
<p>A nested function is when you write a function within another function. For example, finding the average of the sum of values.</p>
<p>The first tip when writing a nested function will be to treat every function individually. So address the first function before addressing the second. A pro tip would be to look at the argument tooltip when writing it.</p>
<p>Let's take a simple scenario.</p>
<p>We have two arrays of numbers. Each has the scores of students in the class. I want to add the two arrays before I get the average. </p>
<p>Let's get started.</p>
<ol>
<li>Type in your = followed by the average.</li>
<li>The number one will be the sum of the scores from class one.</li>
<li>The number two will be the sum of the scores from class two. </li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/09/image-318.png" alt="Image" width="600" height="400" loading="lazy">
<em>Nested Function: Excel AVERAGE and SUM syntax</em></p>
<p><img src="https://lh3.googleusercontent.com/SBV3QpbGiSsXkDoXBpRaRfbjVUjJckLV0crBJ2u5iptUb0C10poCJZIZltv0b13tTTXpABVQ9CvHoAC2S5gwCNMxhaTFX3Y1oyRgNehxFEHPRf_Sm9--HQmVh8ZsVWKsWs2EfQBAEdv6sSTqTP2tmr0JXPb44UmLOO82OzM3oERfntfhPyHQaf1b_w" alt="Image" width="600" height="400" loading="lazy">
<em>Excel AVERAGE syntax</em></p>
<p>Finally, don't forget the closing parenthesis. </p>
<p>Thus, the formula will be <code>=AVERAGE(SUM(B3:B8),SUM(D3:D8))</code>.</p>
<h1 id="heading-how-to-work-with-dynamic-array-functions-in-excel">How to Work with Dynamic Array Functions in Excel</h1>
<p>Dynamic array functions are formulas associated with spill array behaviour. </p>
<p>Before now, you wrote a function and it returned just a single input. We call these kinds of functions legacy array formulas. </p>
<p>Dynamic array functions, on the other hand, will return values that will enter the neighbouring cells. A few examples of dynamic array functions are:</p>
<ul>
<li>UNIQUE</li>
<li>TEXTSPLIT</li>
<li>FILTER</li>
<li>SEQUENCE</li>
<li>SORT</li>
<li>SORTBY</li>
<li>RANDARRAY</li>
</ul>
<p>Let's look at the UNIQUE formula.</p>
<h3 id="heading-how-to-use-the-unique-formula-in-excel">How to Use the UNIQUE() Formula in Excel</h3>
<p>The unique formula works by returning the unique value from an array or list. Let's use the movie sample data from this <a target="_blank" href="https://gist.github.com/tiangechen/b68782efa49a16edaf07dc2cdaa855ea">GitHub Gist</a>. This table contains 77 rows of film excluding the heading.</p>
<p><img src="https://lh5.googleusercontent.com/cgULd4fUAfw1b4J5Q2utiNG_bPSaicGK6vEtuNKS6zCL2IFgoq8ivfZL_UMTTUcRUNc-nVDRxx8O6gQUCba1Eoko6U588n18CsiuBigsVS83V8W8bLZjtltBOqIkWUJRDhhamJzGzqz3FWn_sgVAB3oLJx5L7JOEike_iawhMd7fQHinqfSb_MoaxA" alt="Image" width="600" height="400" loading="lazy">
<em>Flim data GitHub</em></p>
<p>Let's try to get the unique years from our dataset – that is, years without duplicates. </p>
<p>To do this:</p>
<ol>
<li>Type <code>=UNIQUE(</code></li>
<li>Select the entire array of values from the year column: =UNIQUE(H2:H78)</li>
</ol>
<p><img src="https://lh6.googleusercontent.com/mdX9zeClRBtGuzdHukis2gU-2RcH1K2rJvLrUHbSXN2ECokzYTn6SWSLuE2UOACXx3J2DrJQTauzLIb2u5Eqgq1LGvUJXVhpYAZD29CKZnWMBaId2O_6AFHtPJLFbz1FsG7dSIq8zMeRivRwG-qdpw74JG_Qglu4yrlgWIH-8ycQRMQ4cqp1ZNbSgQ" alt="Image" width="600" height="400" loading="lazy">
<em>How to use Excel UNIQUE formula</em></p>
<ol start="3">
<li>Close the parenthesis and press Enter.</li>
</ol>
<p>Though the formula was written in a single cell, the returned value got spilled into the cells below it. That's the spilled array behaviour.</p>
<p><img src="https://lh4.googleusercontent.com/BM4eUSa5hvjSJF4Md2eizx-N97bc2dOdV0LwGYKLErjP4acTf0oCYnjYLhuxs3JHcF7YHyONMWTbXH24Epmc0AT6kvmyL_cg6d0shcKjEmvVL9wN_YQXMpTIGKoh-1dgmfyqUg102K67JsjUGycCMogiCzsIK7E53e7rZ5qd_buCQfylmIH4jHPtaQ" alt="Image" width="600" height="400" loading="lazy">
<em>Excel dynamic array formula</em></p>
<h1 id="heading-how-to-create-your-own-functions-in-excel">How to Create Your Own Functions in Excel</h1>
<p>Microsoft Excel released a bunch of new functions to make user more productive. One of these function was the LAMBDA function.</p>
<p>The LAMBDA function lets you create custom functions without macros, VBA or JavaScript, and reuse them throughout a workbook. </p>
<p>The best part? you can name it.</p>
<h3 id="heading-how-to-use-the-lambda-function-in-excel">How to Use the <code>LAMBDA()</code> Function in Excel</h3>
<p>This LAMBDA function will increase productivity by eliminating the need to copy and paste this formula, which can be error-prone.</p>
<p>Here is the LAMBDA syntax:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/09/image-322.png" alt="Image" width="600" height="400" loading="lazy">
<em>Excel LAMBDA function</em></p>
<p>Lets start with a simple use case using the movie sample data from this <a target="_blank" href="https://gist.github.com/tiangechen/b68782efa49a16edaf07dc2cdaa855ea">GitHub Gist</a>. </p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/09/image-323.png" alt="Image" width="600" height="400" loading="lazy">
<em>The Movie dataset</em></p>
<p>We had a column called "Worldwide Gross", lets try to find the Naira value.</p>
<ol>
<li>Create a new column and call it "Worldwide Gross in Naira".</li>
<li>Right below our column name, Cell I2, type <code>=lAMBDA(</code></li>
<li>LAMBDA requires a parameter and/or a calculation. </li>
</ol>
<p>The parameter means the value you want to pass, in our use case we want to change the gross value. Lets call it gross.</p>
<p>The calculation means the formula or function you want to execute. For us, that will be to multiply it with te exchange rate. At the moment, that's 670. so lets write gross * 670. </p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/09/image-328.png" alt="Image" width="600" height="400" loading="lazy">
<em>How to use LAMBDA function in Excel</em></p>
<ol start="4">
<li>Press Enter. This will return an error because, gross doesnt exist and you need to let excel know of these names.</li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/09/image-329.png" alt="Image" width="600" height="400" loading="lazy">
<em>Using Excel LAMBDA</em></p>
<ol start="5">
<li>To make use of the newly created function, you need to copy the syntax written.</li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/09/image-330.png" alt="Image" width="600" height="400" loading="lazy">
<em>Writing function with Excel LAMBDA</em></p>
<ol start="6">
<li>Go to the formula ribbon and open the name manager. </li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/09/image-332.png" alt="Image" width="600" height="400" loading="lazy">
<em>Excel name manger using the LAMBDA function</em></p>
<ol start="7">
<li><p>Define the name manger parameters:</p>
</li>
<li><p>The name is simply what you want to call this function. I am going with NairaConvert.</p>
</li>
<li>The scope should be workbook because you want to use this function in the workbook.</li>
<li>The comments explains what your function does. It is acts as a documentation.</li>
<li>In the <strong>refer to</strong>, you should paste the copied function syntax.</li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/09/image-333.png" alt="Image" width="600" height="400" loading="lazy">
<em>Excel name manager</em></p>
<ol start="8">
<li><p>Press Ok.</p>
</li>
<li><p>To use this new function, you call it with the name you defined it as—NairaConvert—and give it the gross which is our worldwise gross on G2.</p>
</li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/09/image-334.png" alt="Image" width="600" height="400" loading="lazy">
<em>Custom function with LAMBDA</em></p>
<ol start="10">
<li>Close the parenthesis and press Ok</li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/09/image-336.png" alt="Image" width="600" height="400" loading="lazy">
<em>Calculating with Excel LAMBDA</em></p>
<h1 id="heading-where-can-i-learn-more-about-excel">Where Can I Learn More about Excel?</h1>
<p>There are a ton of resources for learning Microsoft Excel nowadays. So many that it is hard to figure out which ones are up-to-date and helpful.</p>
<p>The best thing you can do is find a helpful tutorial and follow it to completion, instead of attempting to take several at once. I would advise you to start with <a target="_blank" href="https://www.youtube.com/watch?v=Vl0H-qTclOg">freeCodeCamp's Microsoft Excel Tutorial for Beginners - Full Course</a>, which is available on YouTube. </p>
<p>You should also join communities like the <a target="_blank" href="https://www.meetup.com/Microsoft-Excel-and-Data-Analysis-Learning-Community/">Microsoft Excel and Data Analysis Learning Community</a>. However, if you’re looking for a compilation of resources, check out <a target="_blank" href="https://www.freecodecamp.org/news/tag/excel/">freeCodeCamp's publication Excel tags</a>.</p>
<p>If you enjoyed reading this article and/or have any questions and want to connect, you can find me on <a target="_blank" href="https://www.linkedin.com/in/ifeanyi-iheagwara/">LinkedIn</a> or <a target="_blank" href="https://twitter.com/Bennykillua">Twitter</a>. </p>
 ]]>
                </content:encoded>
            </item>
        
    </channel>
</rss>
