MapChartExcelZipCodes

How to Create a Map Chart in Excel Showing the Most Expensive Zip Codes in Each U.S. State

Map charts can help display a lot of data, showing you not only the largest values relative to other values. Below, I’m going to walk you through the steps of creating a map chart using real-world data, which looks similar to the one below:

This is a chart I found on realtyhop.cm that I thought would be good to create from scratch. If you want to follow along, you can download the data from their website.

Here is a snippet of what the data looks like, loaded in Excel:

Table showing Median List prices of homes in the U.S.

You’re not able to create a map chart with a pivot table, so instead, I’ll create the data that is necessary for the map chart. For starters, I’ll use in the UNIQUE function to grab a list of the unique values from the table:

=UNIQUE(Table1[State])

My table is called Table1, with the State field referring to the specific states. This produces a list of unique state values:

A list of U.S. states in an Excel spreadsheet.

Next, I’ll pull in the largest price in the table based on state, using the MAXIFS function:

=MAXIFS(Table1[Median List Price],Table1[State],H2)

Where H2 is the state in my list. After doing that, I also need to lookup the related zip code. For this, I can use the INDEX and MATCH functions to look up multiple criteria:

=INDEX(Table1[Zip Code],MATCH(H2&I2,Table1[State]&Table1[Median List Price],0),1)

Where H2 is the state value and I2 is the median list price. I now have a table that following extracted values:

A table in Excel showing the highest median list price for a home in the U.S. by zip code and state.

In order for the labels to display correctly on the chart, I also need to convert the values so that they show K for thousands and M for millions. The initial formula look as follows:

=IF(I2>=1000000,"$"&ROUND(I2/1000000,1)&"M","$"&ROUND(I2/1000,0)&"K")

What this formula does is checks if the value is at least $1 million, and if it is, then it adds an “M” to the end and converts it to a decimal. If it’s in thousands, then it divides it by 1,000 and adds a “K” to the end.

Here’s what the output looks thus far:

Excel table with list prices converted into K for thousands and M for millions.

The ROUND function is used to limit the decimal places.

Since the labels also incorporate the zip code, that will also need to be added to the label. And since that value needs to be forced onto a separate line, I’ll need to use character code 10 to do that. I need to apply text wrapping to ensure it is displayed correctly in the table. The last thing I’ll do is move the median list price to the end and the label next to the state, making it easy to separate the values.

Excel table that is ready for use in a map chart.

Now with the table setup, the next step is to create a map chart. From the Charts section on the Insert tab, there is an option to select Maps and there is an option for a Filled Map:

Selecting a Filled Map chart in excel.

To ensure the data is selected correctly, right-click on the chart once it is setup and click on Select Data. Under the Legend Entries, ensure that just the column related to the Median List Price is selected. And for the Horizontal Category, just the first two columns for State and Label are selected. If you’ve set it up correctly, you should see something like this:

Map chart in Excel.

Next, it’s time to add the labels. Right-click anywhere on the chart and select Add Data Labels. Then right-click on any of the labels and select Format Data Labels. From here, you want to select the Category Name option — this pertains to the label column that was created earlier, which combines the value along with the zip code. Now the chart looks as follows:

Map chart with labels displaying values.

Now, let’s adjust the color scheme so that it is red. Right-click on the data series again, then open up a section under the series option which says Series Color:

Adjusting the series color for a map chart in Excel.

You can adjust the color based on the minimum, midpoint, and maximum values, and the gradient will update accordingly.

This now gives me a map chart that is highlighted in red:

Map chart in Excel highlighted in red.

All that’s left at this point is to apply a title, and this can be done with the use of a text box. And after adding vertical red line next to the title, we get a fairly similar chart to the one initially shown:

Map chart in Excel highlighted in red with a title.

If you liked this post on How to Create a Map Chart in Excel Showing the Most Expensive Zip Codes in Each U.S. State, please give this site a like on Facebook and also be sure to check out some of the many templates that we have available for download. You can also follow me on Twitter and YouTube. Also, please consider buying me a coffee if you find my website helpful and would like to support it.

RandomNonRepeating

How to Generate a List of Non-Repeating Random Numbers in Excel

Do you want to create a list of random numbers in Excel, but avoid repeating values? Below, I’ll cover how you can set that up to ensure that no number is shown more than once — all through just a single formula.

Start with the SEQUENCE function

The first thing that’s necessary is to create a list of numbers to choose from. It needs to be in the form of an array, which can then be sorted. Using the SEQUENCE function, I can create an array which goes from 1 to 10 with the following formula:

=SEQUENCE(10,1)

The first argument specifies the rows to fill in, and the second one is the number of columns. If you wanted to start from the number 2 and jump by 3 values at a time, the formula would be as follows:

=SEQUENCE(10,1,2,3)

This produces the following, unsorted list:

List generated by using the sequence function in Excel, which starts from the number 2 and jumps by 3s.

The next step is where the numbers get reordered. Another array of numbers needs to be created. This time, I’ll use the RANDARRAY function, since I want the array to be entirely random. I will again need to specify the number of rows and columns to fill in:

=RANDARRAY(10,1)

This produces a list of random numbers, similar to how the RAND function works. The only difference is that it creates a list for you:

Using the RANDARRAY function to create an array of random values.

Next, let’s combine these two formulas, within the SORTBY function. With the SORTBY function, you can specify the range you want to sort, and how you want it to be sorted. The complete formula is displayed as follows:

=SORTBY(SEQUENCE(10,1,2,3),RANDARRAY(10,1))

And this will now sort the sequence randomly. Here is the sorted and unsorted sequence, side by side:

Unsorted and randomly sorted columns in Excel.

The column on the left, shows the unsorted values, as they have been created with the SEQUENCE function. The column to the right, however, has applied a random sort with the help of the RANDARRAY and SORTBY functions. The values are randomized and do not repeat. If you want to re-sort them, you just need to trigger a recalculation. This can be done by just pressing the delete key on any cell.

For this to work, both arrays have to be sized the same. In both functions, 10 rows and 1 column are used. However, if they are not the same size, the formula will produce an error. You could decide to have 1 row and 10 columns to display the values horizontally, with the following formula:

=SORTBY(SEQUENCE(1,10,2,3),RANDARRAY(1,10))

This will produce a randomized list which goes horizontally:

Random list without repeating numbers in Excel.

At this stage, you could use this random list as is or you could also combine it with a lookup function to extract a certain item based on a pre-defined value.


If you liked this post on How to Generate a List of Non-Repeating Random Numbers in Excel, please give this site a like on Facebook and also be sure to check out some of the many templates that we have available for download. You can also follow me on Twitter and YouTube. Also, please consider buying me a coffee if you find my website helpful and would like to support it.

TRIMRANGE

How to Use the TRIMRANGE Function in Excel

Microsoft Excel has recently rolled out a new function, TRIMRANGE. And as its name suggests, it will help you trim a range, to ensure that your formula is efficient and isn’t including unnecessary blank values in calculations. Here’s a breakdown of the function.

The inputs for the TRIMRANGE function

There are three arguments to enter for the TRIMRANGE function:

Range: the range that you want to trim.

Trim_Rows: specify which rows to trim from the specified range. 0=no rows; 1=leading blank rows; 2=trailing blank rows; and 3=both leading and trailing blank rows (this is the default).

Trim_Columns: specify which columns to trim from the range. 0=no columns; 1=leading blank columns; 2=trailing blank columns; 3=both leading and trailing blank columns (default).

If you just want to trim everything, then you don’t need to worry about entering any arguments beyond just the initial range you want to trim.

How to function works

In the following example, I have values filled in only up until row 11:

Values in Excel filled up until row 11.

With the TRIMRANGE function, I can select the entire range A:B, and it will return an array of the values which only contain values. The formula only requires that one range.

=TRIMRANGE(A:B)

This is the result:

Result of the TRIMRANGE function.

If, however, there are gaps within the data set, then it will return zero values:

Result of the TRIMRANGE function when there are gaps within the range.

Where it performs well is when it excludes leading and trailing empty spaces:

Result of the TRIMRANGE function when there are gaps before or after a range.

If you like this post on How to Use the TRIMRANGE Function in Excel, please give this site a like on Facebook and also be sure to check out some of the many templates that we have available for download. You can also follow me on Twitter and YouTube. Also, please consider buying me a coffee if you find my website helpful and would like to support it.

GoogleSheetsDynamicCalendar

Free Google Sheets Calendar Template to Track Bills and Events

Want to track events, bills, and tasks easily? Rather than using different apps, you can do all of that right within Google Sheets. Whether you’re using your home computer or using your phone, it’s easy to access Google Sheets — all you need is a link to the sheet that you’re using. In this article, I’m going to share with you my free Dynamic Calendar Template which will make it easy to keep track of all your important dates and deadlines. Below, I’ll leave a link to the file, where you can create a copy of it and use it for your own personal needs, and it’s completely free.

How the Dynamic Calendar Template works

There is just one main tab on the Dynamic Calendar Template, where you can enter your events and see your calendar at a glance. In its most basic form, it gives you an easy way to view the current month, and easily change from one period to another.

Dynamic calendar template in Google Sheets.

By default, it will automatically set to the current month. If, however, you prefer to change the period, you can override the formula in cell C3 by just entering the month and year. For example, typing in ‘April 2025’ will update the calendar to that month and year. Simply enter it in that format and it will update accordingly.

You’ll notice that the current day is highlighted in yellow. And at the top, there is a drop-down option next to the date. This allows you to use to swap between different calendars. If you want to see all due dates and events, simply leaving the ‘All’ option selected. But each day is limited to five events, so if you have more than that, you’ll want to consider using more than one calendar type.

Setting up different calendars

In column Q, there is a table for different calendars. In addition to All, there are Personal and Work calendars setup as well. If you select All, however, all of your items will be included on the calendar, regardless of which option you designate for your event. But if you select Personal, Work, or another calendar type, only entries for that calendar will be displayed. If you want to enter a new calendar type, simply enter a value below the latest one, the Work calendar, so that the table expands:

Different calendar types.

In the above example, I’ve added a ‘Stocks’ calendar to track events related to stocks, potentially including earnings dates and other stock-specific events.

Creating events

Once you’ve setup your calendars, you can begin entering events in columns L:O. While this is called ‘events’ it can technically include anything you want to keep track of — meetings, bills, etc.

There are just four fields to enter values for:

  • Date: the day the event takes place
  • Event Description: what the event is
  • Calendar: which type of calendar it falls under
  • Flag: if you want to flag this with a certain color (currently you can use black, blue, or red flags)

In the following example, I’ve entered three events for March 5, 2025:

Events entered on the dynamic calendar template.

While I have entered in a value for a flag, this is not necessary. With my ‘All’ calendar drop-down option selected, I see all of these events displayed for March 5:

Dynamic calendar template showing multiple events.

However, if I change the calendar to show only Personal, only the Mortgage Payment event which was tagged with that calendar, will appear:

Dynamic calendar template showing events for the personal calendar.

Download the free template

You can download the Dynamic Calendar Template from this link, which will prompt you to create your own copy. In order to ensure it works as designed, please avoid making changes to other cells. The only places you should make inputs are in the month and year (should you want to change the default from the current period), and the two tables — one to manage events, and the other for the different types of calendars. If have also created an Excel-based calendar, which you can check out here.


If you like this Free Google Sheets Calendar Template to Track Bills and Events, please give this site a like on Facebook and also be sure to check out some of the many templates that we have available for download. You can also follow me on Twitter and YouTube. Also, please consider buying me a coffee if you find my website helpful and would like to support it.

VisualizeRanges

How to Create Dynamic Min-Max Range Charts in Excel

A good chart in Excel can display a lot of useful information in one visual. In this example, I’m going to show you how to display minimum and maximum values, as well as the range between them. This can be helpful in reviewing products to identify not only how cheap or expensive they may be, but also how much the price has fluctuated in the past. Narrow ranges may imply not a lot of movement, whereas wide ones could mean that there’s a lot of variation, and opportunity to buy that product at a lower price, assuming that past trends repeat.

For this example, I’m going to use some tech products and use sample price ranges that might be applicable to them:

A table of tech products, showing minimum and maximum values.

Calculating the range between min and max values

Determining the range can help you analyze just how large the delta is between two values, particularly the high and the low. To calculate it, simply take the maximum value and subtract the minimum. Assuming my first max price is in C2 and the min price is in B2, here’s how the formula will look:

=C2-B2

This value is entered into the next column, resulting in the following column added to this table:

Table in excel showing a list of tech products, displaying their minimum and maximum values, along with their ranges.

You can quickly spot the product with the largest range — the smartwatch. The high-priced item can have significant fluctuations depending on the quality and features it offers. The more modestly priced flash drive, however, has a much smaller range and less room for variance.

Plotting the values on a bar chart

The next step involves putting all this data on a chart. In particular, you’ll want to create a stacked bar chart. When selecting your data ensure you select the first option on the stacked bar section, which doesn’t contain a large legend. In this example, there should only be three different series: min, max, and range.

Selecting a stacked bar chart in excel.

Modify the bar chart hierarchy

In order to ensure that your bar chart is displaying correctly and stacking properly, you’ll want to modify the way the different series are ordered. Right-click on the chart and click Select Data. By default, it will arrange the data in the order of the columns. However, I want to ensure that the range comes between the min and max values. That way, the min value is added first, then the range is stacked, followed by the max value. By using the arrow keys under the Legend Entries, you can adjust the order of the series. This is how it should look:

Data in a bar chart with the legend first stacking the minimum value, followed by the range, and then the maximum price.,

Adjusting the fill colors

By changing the hierarchy, you can ensure the chart is stacked in the correct order. But you’ll still want the min and max bars to not be visible. The point is to plot those values but to only show the range. To do this, right-click on any bar chart and select Format Data Series.

Select the fill bucket, and ensure that the series you’ve selected is either the min or the max. This can be done click clicking on the down arrow next to Series Options:

Selecting the correct series using the series options drop-down menu in Excel.

This can be an easy way to select the correct data series. Now, with the correct field select, you can go back to the fill settings and chose the option for No fill.

Selecting the no fill option in Excel for a bar chart.

Now, repeat these steps for the other series. In my example, that’s going to be the Min price. And now, after selecting no fill, I’m only left with a chart that shows the range:

Chart in excel showing a range of values.

Adding min and max labels to the chart

What you may also want to do is add labels to the chart, to display the maximum and minimum values. To do this, right-click on either one of the bars that doesn’t pertain to the range, and select Add Data Labels. You’ll see a number displayed, and if you right-click on it, you can select the option to Format Data Labels.

Formatting data labels on an Excel chart.

You can adjust the label to show it in the center, inside end, or inside base. Inside base will put at the start of the bar value, while inside end will display it at the end. In my example, I’m selecting inside end for the minimum value, so that its shows towards the right.

I’m also going to right-click on the label and select Change Data Label Shape and select a rounded rectangle, to ensure the value is easy to see.

Changing the data label shapes on a chart in Excel.

I’ll repeat the steps for the maximum value label, and select inside base. And with the rounded rectangle added, this is how my chart looks after these changes:

Chart in excel displaying min, max, and range values.

Formatting changes and final adjustments

The only thing left to do at this stage is to apply any final changes. Since I have the min and max values listed, I’m going to opt to remove the axis at the bottom, and add only horizontal gridlines. I can also remove the legend since the min and max values should be self explanatory. I’ll also change the bar chart color to a light blue color.

Chart in excel displaying min, max, and range values.

If you like this post on How to Create Dynamic Min-Max Range Charts in Excel, please give this site a like on Facebook and also be sure to check out some of the many templates that we have available for download. You can also follow me on Twitter and YouTube. Also, please consider buying me a coffee if you find my website helpful and would like to support it.

VisualizeText1

How to Create a Word Cloud in Excel With Python

In Microsoft 365, you can now use python to help you analyze and summarize data. And one of the cool things you can do is to create a word cloud. A word cloud allows you to visualize data, specifically words, to see which ones appear most often. It can be an effective way to identify trending topics and keywords from a series of text.

For the example below, I’m going to use a word cloud to visualize Nvidia’s most recent earnings transcript, to determine which words were most prominent on the tech company’s latest earnings call. In particular, I’m going to pull the text from the question and answer section of the earnings transcript to see what analysts and management were talking about, to get an idea of which words were used more often.

The text can be grabbed in its entirety and pasted into a single cell in Excel. To get the Word Cloud to display properly, I’ll need to create the python code. I’ll break down the full code and share it with you, which you can use in your own spreadsheet.

How do you enter python code in Excel?

First thing’s first, you’ll need to enter python code properly in Excel. This isn’t just entering a regular formula that starts with an = sign. Instead, go to the Formulas tab, and there, you’ll see an option to Insert Python:

Inserting python code in Excel.

Once you click on that, you’ll see a change to your formula bar with a green column with the letters PY in it:

Entering python code in Excel.

You can now enter python code in the formula bar, and Excel will understand what you’re trying to do. And as you can see from the message below the formula bar, you’ll also need to hit Ctrl+Enter when you’re done. This will run the code. Otherwise, just pressing enter will move down a line within the python code.

Populating the code

Next, it’s time to actually put the code into the formula bar. Here’s a brief breakdown of how the code functions.

First, for the code to work, I need to import the necessary libraries and modules, which includes wordcloud and matplotlib. I also need to ensure the data is pulling from a specified cell, which in my example will be cell A1 in Sheet1.

In order to avoid commonly used words, I’ll also use a list of predefined stopwords, which can exclude common words that wouldn’t be useful in analyzing text. I’ll also add a custom list of stopwords which I can add to exclude even more words that I might not find helpful.

The last part involves creating the word cloud and visualizing it. You can adjust the height and width and background color to your preference. Here is the full code you can use in your spreadsheet:


from wordcloud import WordCloud, STOPWORDS
import matplotlib.pyplot as plt

def visualize_text_trends():

    # Get the text from cell A1
    Dataframe = xl("Sheet!A1")
    

    # Define stopwords to exclude common articles and words
    stopwords = set(STOPWORDS)

    # Add custom stopwords
    custom_stopwords = {"will", "new", "going", "use", "thank", "operator", "question", "really", "come"} 
    
    stopwords.update(custom_stopwords)
    
    # Generate the word cloud
    wordcloud = WordCloud(stopwords=stopwords, background_color='white', width=800, height=400).generate(Dataframe)

    # Display the word cloud
    plt.figure(figsize=(10, 5))
    plt.imshow(wordcloud, interpolation='bilinear')
    plt.axis('off')  # Hide axes
    plt.show()


# Run the function
visualize_text_trends()

You can see the custom stopwords I added and you can modify it to suit your individual analysis. Since there are a lot of questions and answers on an earnings transcript and an operator is involved, I’ve excluded the words ‘operator’ and ‘question’ along with other words that you may prefer to keep.

After committing the above code, it produces the following in cell B1 (which is where I’ve entered it):

To convert this into an actual word cloud, I’ll enter the following in cell C1:

=B1.image

The data is then converted into the following:

Unsurprisingly, AI is one of the most common words on the earnings call. Blackwell, Nvidia’s AI chips, are also referred to often. Software, model, and system also are prominent words based on this analysis.


If you like this post on How to Create a Word Cloud in Excel With Python, please give this site a like on Facebook and also be sure to check out some of the many templates that we have available for download. You can also follow me on Twitter and YouTube. Also, please consider buying me a coffee if you find my website helpful and would like to support it.

VisualizeTrends

Highlight the Largest Values in Excel With Conditional Formatting

Microsoft Excel can help you analyze data, even without having to do any computations. By simply setting up conditional formatting rules, you can easily visualize data and identify trends. Doing that can help focus your attention on key numbers and make your analysis process much more efficient. In the following data set, I have a list of investment returns by year. I’ll show you how you can setup a rule to highlight which return was larger in each year:

Investment returns by year in an Excel table.

Creating the conditional formatting rule

To create a conditional formatting rule to highlight the largest values, I’m going to select column B. Then, I’m going to go into the Conditional Formatting menu on the Home tab and will click on New Rule.

Creating a new conditional formatting rule.

Under the option for the rule type, I’m going to select use a formula to determine which cells to format, and I’ll enter the following formula:

=B1>C1

Then I’ll adjust the format so that the cell has a dark grey color and a white, bolded text.

Conditional formatting rule in Excel comparing values.

After clicking apply, the formatting will take effect:

Conditional formatting rules applied to an Excel spreadsheet, highlighting the largest amount.

A similar rule needs to be setup for column C. And in this case, I’ll highlight the values in blue.

Setting up a conditional formatting rule to check if a value is greater than another.

Now there is highlighting applied to both columns:

Conditional formatting rules applied to an Excel spreadsheet, highlighting the largest amount in multiple columns.

However, the header is also highlighted in column C. To fix this, I’ll add a condition to check to make sure that it is a number:

Setting up a conditional formatting rule to check if a value is greater than another and that it is also a number.

Now the conditional formatting is properly applied, and ignores the header row.

Conditional formatting rules applied to an Excel spreadsheet, highlighting the largest amount in multiple columns.

If you like this post on How to Highlight the Largest Values in Excel With Conditional Formatting, please give this site a like on Facebook and also be sure to check out some of the many templates that we have available for download. You can also follow me on Twitter and YouTube. Also, please consider buying me a coffee if you find my website helpful and would like to support it.

StockTradingTemplate2025

2025 Stock Trading Template

If you want to track your investments and stay on top stocks in a watchlist, I’ve created a template which will make that easy to do. My 2025 Stock Trading Template is a free template in Google Sheets that you can use for that purpose. It will give you a place to enter trades, populate a watchlist, and visually see how your investments are doing on a dashboard. Below, I’ll go over how the template works and how you can access it.

Entering in stock trades on the template

The template contains an Activity tab where you can enter any buy and sell transactions. You can also specify cash-only transactions if you make a deposit or withdrawal. It’s also possible to enter both a trade and a cash transaction on the same line.

In the screenshot below, you’ll see a cash-only transaction on the first row, and the one below has a stock purchase along with cash deposit amount. Any withdrawals should be entered as negative values in column D. This is for the purpose of tracking both the value of your investments and cash in your portfolio.

Activity tab on the 2025 stock trading template in Google Sheets.

You’ll want to reconcile your cash balance in the last column to ensure that it is properly accounted for. The current value of your holdings will pull into Google Sheets using the most recent stock prices; there’s no need to update the current price.

The only columns you need to populate in this table are A:G. The others will calculate automatically.

Keeping track of a watchlist

If you want to also track certain stocks, you can do so using the Watchlist tab. Simply enter the ticker symbol in column A and the value in column B will populate, which shows the stock’s percent change for the most recent trading day.

You only need to enter data in column A. The rest of the values will populate on their own and display on the summary tab.

List of stocks to watch on the 2025 stock trading template in Google Sheets.

View your holdings and watchlist on the summary tab

Once you’ve entered your holdings and the stocks you want to track, you can head over to the Summary tab which will summarize your financial position. Here you’ll see the current value of your investments, your gains and losses, and your return over the trailing 12 months (TTM) as well as how stocks have been performing in individual months.

Below the headers, in row 4, you’ll also see your watchlist, sorted in order of highest to lowest returns for that day. It will cut off after 300 characters so you may not see all of them on there if you have a large watchlist.

2025 stock trading template showing the dashboard in Google Sheets.

Download the template

You can access the Google Sheets template in the link below, which will prompt you to make a copy of it. I have entered some sample data for you to see how it works, and you can overwrite it with your own entries.

2025 Stock Trading Template

If you have any feedback, comments, or suggestions for improvement on the template, please feel free to contact me and let me know.


If you like the 2025 Stock Trading Template, please give this site a like on Facebook and also be sure to check out some of the many templates that we have available for download. You can also follow me on Twitter and YouTube. Also, please consider buying me a coffee if you find my website helpful and would like to support it.

DynamicConditionalFormatting

Dynamic Conditional Formatting: How to Link Rules to Specific Cells

If you want to create conditional formatting rules but want to easily change the cutoff values for them, you can link your rules to specific cells, to make that process easy. Below, I’ll show you how to make your conditional formatting rules dynamic. Rather than going into the settings each time, you can just update specific cells, which will change your cutoff points.

Creating conditional formatting rules for changes in stock prices

A common example where you might want to adjust the cutoff values for conditional formatting rules is when dealing with stock prices. Suppose you want to highlight stocks when they have risen by more than 5%. But in other cases, such as when you’re looking at a long time frame, you may want the threshold to be much higher than that. This is where linking conditional formatting rules can be advantageous, by making the update process easier.

In the spreadsheet below, I have a list of stocks and their respective returns between December 31, 2024 and January 31, 2025. I have pulled in their performances using Excel’s STOCKHISTORY function.

Stock returns for the magnificent seven, between Dec. 31, 2024 and Jan. 31, 2025.

In this scenario, I may want to highlight stocks which have returns of more than 5% as green, and those which are down by 5% in red. I’ll create two conditional formatting rules to highlight both the return and the stock. Here’s how one of the rules looks:

Conditional formatting rule highlighting a value if it is greater than 5%.

The downside of this rule is that the 0.05 value is hardcoded. If I want to change the threshold, I would need to go back into the conditional formatting rules and modify it. There is an easier way around this, and that’s by just linking to a specific cell.

Custom conditional formatting thresholds setup in Excel.

In the above example, I’ve entered the values that I want to link my conditional formatting rules to. In the case of a green highlight, I’m going to link to cell E2. And when I’m formatting the cells red, I’ll link to cell E3. Here’s how my updated conditional formatting rule will look:

Conditional formatting rule which links to a specific cell.

Now, I’ve removed the hardcoded value and my conditional formatting rule now points to a specific cell, which is frozen and doesn’t change. To do the same thing for my red highlight rule, when the values are down 5%, I do the same thing, except flip the sign and refer to cell $E$3:

Conditional formatting rules for negative returns.

My conditional formatting rules are correctly applied to my data set, highlighting returns of more than 5% in green, and returns of less than negative 5% in red:

Conditional formatting rules applied using cells in Excel.

The advantage here is I can easily update my thresholds by just modifying the values in column E. If I change them to 10% for green and -10% for red, I simply make the changes in those cells and my conditional formatting updates immediately:

Updated conditional formatting rules for returns of greater than 10% and less than negative 10%.

By setting up my conditional formatting rules this way, it’s easy to update the process in seconds and at the same time, I can see what my threshold are.


If you like this post on How to Apply Dynamic Conditional Formatting and Link Rules to Specific Cells, please give this site a like on Facebook and also be sure to check out some of the many templates that we have available for download. You can also follow me on Twitter and YouTube. Also, please consider buying me a coffee if you find my website helpful and would like to support it.

maxresdefault

Use Excel’s Image Function to Populate Logos

The IMAGE function in Excel is one of the newer ones you can use. And it can make importing images into your spreadsheet a whole lot simpler than saving, uploading, and then inserting them. I’ll also show you how to setup a template where you can dynamically import logos from a website.

How the Image function works

The main ingredient for the IMAGE function is the URL of the image you want to use. This means you no longer have to save an image you want to use. All you need to do is to point to where it is found online. Suppose, for example, I want to insert Netflix’s logo into my sheet. I can look for the logo online, and then copy the URL into the formula’s first argument:

=IMAGE(“https://upload.wikimedia.org/wikipedia/commons/thumb/7/7a/Logonetflix.png/1200px-Logonetflix.png”)

This will now display the Netflix logo in the cell:

Netflix logo displayed on an Excel spreadsheet using the IMAGE function.

By expanding the cell, the image will automatically expand. It will do so in accordance with its dimensions.

Netflix logo expanded to fit the cell.

Other arguments in the IMAGE function include the following:

  • Alt_Text: this is what will show if the image cannot be displayed.
  • Sizing: this determines how the image should be displayed and contains the following options:
    • Fit Cell: This is the same as the default behavior, where it will expand based on the size of the cell, while maintaining its true dimensions.
    • Fill Cell: This will fill the cell as much as possible and may result in the image stretching.
    • Original Size: This will be based on the original image’s size; no scaling will take place and if the image is very large, it may not fully display in the cell.
    • Custom Size: A custom size needs to be set in the height and width arguments.

The simplest option is to simply leave the default options, allowing the image to automatically expand based on the size of the cell. This ensures the image is not stretched out and gives you a lot of control over how it is displayed, without worrying about setting custom dimensions.

Creating a formula to populate logos

You can create a formula which will dynamically adjust based on your inputs, and pull in different images accordingly. Suppose you wanted to pull in logos for companies. You could do that by using a website such as logo.clearbit.com. The site has links to images based on their domains. While it may not work in the future, the way it’s linked gives you an idea of how this can be setup.

For example, the URL https://logo.clearbit.com/netflix.com will link to an image for Netflix. Different domains will show different images. If I setup a formula which connects the IMAGE function and starting URL along with a domain, I can make this dynamic so that the logos will update based on the domains I input.

=IMAGE(“https://logo.clearbit.com/”&B1)

The above formula will use the IMAGE function and combine the clearbit URL along with what I have entered in cell B1. And if that’s set to a domain, the image will update accordingly. Here’s how the formula works with multiple examples:

Image function in Excel pulling in different logos based on their domains.

The formulas are in column A and rely on the values in column B to create the full URL, which includes the clearbit site along with the domain. The end result is an easily updatable function which pulls in images based on my entries in column B.

You can create a similar type of setup if you host images on a site. By creating consistent names for your images, you can use them within the function so that you can easily point to the images you want.


If you like this post on How to Use Excel’s Image Function to Populate Logos, please give this site a like on Facebook and also be sure to check out some of the many templates that we have available for download. You can also follow me on Twitter and YouTube. Also, please consider buying me a coffee if you find my website helpful and would like to support it.