• Link to Facebook
  • Link to Youtube
  • Link to LinkedIn
  • Link to X
  • Link to Tiktok
  • Link to Instagram
  • EN ESPAÑOL
    • Inicio
    • Glosario de Términos
    • Modelos Financieros
    • Tutoriales Cortos
  • A.CRE HELP
    • Support Section
    • Contact Us
  • LOGIN/REGISTER
  • Shopping Cart Shopping Cart
    0Shopping Cart
Adventures in CRE
  • A.CRE
    • A.CRE Home
    • A.CRE Help
    • Accelerator
      • Learn More
      • Login
    • AI.Edge
      • Learn More
      • Login
    • Artificial Intelligence
    • Careers
    • CRE Event Calendar
    • CRE Job Board
    • Education
    • Library of Excel Models
    • Meet the A.CRE Team
  • RE Modeling
    • 1031 Exchange
    • Audio Series
    • All-in-One (Ai1) Model
      • Download
      • Guides and Tutorials
      • Support
    • Ask Me Anything (Live)
    • Beginner’s Guide to Excel
    • Excel Models
      • Excel Add-ins
      • Library of Excel Models
      • All-in-One (Ai1) Model
      • Apartment
      • Condo
      • Debt
      • Development
      • Equity Waterfall
      • Hotel
      • Industrial
      • Office
      • Portfolio
      • Retail
      • Single Family
      • Tutorial
    • Excel Tips
    • Practice Library of Case Studies
    • Stochastic Modeling
    • Argus
    • My Downloads / My Account
  • Careers
    • About Careers in Real Estate
    • Ask Me Anything (Live)
    • Audio Series
    • Compensation in Real Estate
    • CRE Job Board
      • Find a Job
        • Browse Jobs
        • Post a Resume
        • Register
        • Login
      • Post a Job
    • CRE Event Calendar
    • CRE Interviews
    • Day in the Life Series
    • Real Estate Legal Content
    • What CRE Pros Do
  • Education
    • Accelerator
    • AI.Edge
    • A.CRE 101
    • Ask Me Anything (Live)
    • A.CRE Audio Series
    • Audio Series
    • Book Reviews
    • CRE Event Calendar
    • Deep Dive Series
    • Glossary of CRE Terms
    • Real Estate Legal Content
    • Real Estate Clubs
    • University Profiles
    • Watch Me Build
  • AI
    • AI Skills
    • AI Use Cases in CRE
    • AI for CRE Training
    • AI Tools for CRE
    • AI.Edge Membership
      • Learn More
      • Login
  • Accelerator
    • Accelerator Reviews
    • Accelerator Story
    • Enroll Now
    • Learn More
    • See What’s New
    • Enterprise Members Only
      • General Enterprise Login
      • ICSC Login
      • M&M Login
    • Members Only
      • Extend/Renew Membership
      • Login
      • Manage Membership
  • My Downloads
    • View My Downloads
    • Find an Excel Model
    • Register
    • Login
  • Click to open the search input field Click to open the search input field Search
  • Menu Menu
You are here: Home1 / Real Estate Financial Modeling2 / Excel Tips3 / How to Create Dynamic, In-Cell Buttons and Toggles in Microsoft Excel
Spencer Burton
Real Estate Financial Modeling, Excel Tips, Excel Models, Tutorial

How to Create Dynamic, In-Cell Buttons and Toggles in Microsoft Excel

Creating intuitive, user-friendly, visually appealing models is one aspect of mastering real estate financial modeling. One way to make your models easy for people to use and more attractive in general is to use dynamic, theme-appropriate, in-cell buttons (ie. a button that changes text, font, background based on certain logic) and toggles (i.e. buttons to select between two or more options).

In this tutorial, I show you a simple way to create these types of buttons and toggles in Excel. I’ve recorded a video, written a step-by-step guide, and posted two Excel Workbooks used in the video tutorial (a completed Workbook and a blank Workbook with formatting in place).

Excel Button Toggle

This “Click to Recalculate” button found in one of my apartment development models only appears when the model needs to recalculate. I use dynamic buttons such as this to make for a more intuitive, user-friendly experience.

Step-by-Step Guide to Creating a Dynamic Button and Toggle

In this guide, I add a hypothetical multifamily module to a real estate model. When the multifamily module is activated, an MF Development CF tab and an MF Operating CF tab appear. When the multifamily module is turned off, those same tabs disappear. While you may not intend to replicate this exact scenario in your situation, the basics steps used in this tutorial can be applied to any project.

You might also check out one of our multifamily real estate Excel models.

Step 1 – Set up the multifamily module tabs

This is already done in the blank template attached below, but the first step is to create the two multifamily tabs that will be the crux of the multifamily module. Simply hover over the existing tab at the bottom of the window, right-click, select ‘Insert…’, and then rename the tab ‘MF Development CF’. Do this a second time, only renaming the cell ‘MF Operating CF’.

When the module is on, these two cells will be visible. When it is off, they will be hidden.

Step 2 – Assign a cell to track whether the multifamily module is on or off

The second step is to set one cell aside to track whether the multifamily module is on or off. This cell will be a ‘Named Cell’ (see how to create named cells and ranges), and the value within this cell (either 0 or 1) will be changed by Macros that will be written to turn the multifamily module on and off.

To do this, I first choose a cell. In this case, I’ll choose cell A7. I then name cell A7 to be ‘MF_Module_On?’ by going to the A7 cell name box in the upper left-hand corner of the Excel window and changing A7 to MF_Module_On?. With the cell assigned to this task, I simply enter 1 into that cell to denote that the module is on.

The idea is that, when the cell contains a 0, the module is off while when the cell contains a 1, the module is on.

Step 3 – Write two macros, one that turns the multifamily module on and one that turns it off

The next step is to write or record two macros. The first macro – MF_Module_Off – will turn the multifamily module off by first, changing the value in the MF_Module_On? cell to 0 and then hiding the two MF tabs. The second macro – MF_Module_On – first changes the value in the MF_Module_On? cell to 1, and then unhides the two MF tabs.

The video tutorial shows you in more detail how to record these macros in Excel.

Step 4 – Create the ‘Turn Off’ button

With the MF_Module_On? cell in place and the two macros written, we’ll now create our dynamic, in-cell button. To do this, first select which cell will contain the button. I’ll use cell H4.

In cell H4, I enter the following logic: =IF(MF_Module_On? = 1, “Turn Off”, “”). What this logic says, is if the value in the MF_Module_On? cell is equal to 1 (i.e. the module is currently on), then have cell H4 output “Turn Off”, otherwise leave the cell blank.

With the above logic written, I now need to add conditional formatting that will turn the cell background red with white font when the module is on. To do this, I go to ‘Home>Conditional Formatting>New Rule>Use a Formula to determine which cells to format’. I click the ‘Format values where this formula is true:’ box and enter =MF_Module_ON? = 1. I then, click the ‘Format’ box and select a red background with a white font. After clicking ‘OK’, the cell will now be set to turn red with white font when the multifamily module is on.

With the conditional formatting in place, it’s time to add the button. Go to ‘Insert>Shapes>Rectangle’ and draw a rectangle exactly the same size and within the exact area of the cell H4. Then, with the newly added rectangle selected, change the rectangle’s background color and outline color to ‘No Outline’.

Finally, select the now invisible rectangle, right-click, and select ‘Assign Macro’. Choose the macro you wrote to turn off the multifamily module – in my case the macro is called MF_Module_Off.

Fun Fact: I use the In-cell button technique in my All-in-One model. Go download the model, head to the S&U tab (the tab only becomes visible with the Development module active), and change the assumed LTC. You’ll see a box appear asking you to recalculate the construction interest.

When the multifamily module is on, the button should be red with the words “Turn Off”. You should be able to click it, which will consequently hide the MF tabs and the button will disappear.

Excel Button Toggle

This dynamic, in-cell button is visible when the multifamily module is on. Clicking the button turns the module off, and the button disappears.

Step 5 – Create the On/Off Toggle

Steps to creating the toggle are substantially similar to creating the button, only there will be two buttons. One button turns the multifamily module on, and the other button turns the multifamily module off. It is a toggle, because the conditional formatting logic is such that the background color and font color change in each cell depending on whether the module is on or off.

First select which two adjacent cells will contain the ‘On’ and ‘Off’ toggles. I’ll use cell G7 for ‘Off’ and H7 for ‘On’. Type “Off” in cell G7 and “On” in cell H7. Next, change the base formatting for both cells to a dark background with light font. In this case, I’ll use a dark green background with a white font.

With “Off” and “On” written in the cells and the cells both having a dark green background with white font, it’s time to use conditional formatting to change the color of the cells depending on whether the multifamily module is on or off. If the module is on, I’ll set the ‘Off’ cell to a white background, with dark green border and grey font. Likewise, if the module is off, I’ll set the ‘On’ cell to have a white background, with dark green border and grey font.

This is done by selecting each cell individually, going through the conditional formatting process explained in Step 4 above, and using logic such as =MF_Module_On? =1 for the ‘Off’ cell and =MF_Module_On? =0 for the ‘On’ cell. If done correctly, you can manually change the value in the MF_Module_On? named cell and the ‘On’ and ‘Off’ cells will toggle from dark background to light background depending on whether the module is on or off.

Finally, using the same process employed in Step 4, add invisible rectangles into each cell and assign each a macro. Assign the multifamily module off macro to the ‘Off’ box/cell and the multifamily module on macro to the ‘On’ box/cell.

Step 6 – Verify that the Buttons and Toggles Work

Once you’ve finished Steps 1 through 5, click the button and toggles to verify that they are working correctly. When the module is on, the ‘Turn Off’ button should be red, the ‘Off’ toggle should have a light background while the ‘On’ toggle should have a dark background. When the module is off, the ‘Turn Off’ button should be hidden, the ‘Off’ toggle should have a dark background while the ‘On’ toggle should have a light background.

Excel Button Toggle

Use a dynamic, in-cell toggle to illustrate two selection options.

Video Tutorial on How to Create a Dynamic Button and Toggle in Excel

Below find a screenshare video I created showing you how to create a dynamic, in-cell button and toggle. I recommend you download the accompanying Excel Workbooks – one is a completed file while the second is a blank Workbook with the formatting and MF tabs added for you. Use the blank Workbook to follow along with the tutorial.

Download the Source Files for this Tutorial

To make these files accessible to everyone, they are offered on a “Pay What You’re Able” basis with no minimum (enter $0 if you’d like) or maximum (your support helps keep the content coming – similar real estate training exercises sell for $100 – $300+). Just enter a price together with an email address to send the download link to, and then click ‘Continue’. If you have any questions about our “Pay What You’re Able” program or why we offer our models on this basis, please reach out to either Mike or Spencer.

Proceed to Download Page

Frequently Asked Questions about Creating Dynamic, In-Cell Buttons and Toggles in Excel

What is a dynamic in-cell button in Excel?

A dynamic in-cell button in Excel is a cell that changes its appearance—such as text, background color, and font—based on certain logic or conditions, often using formulas and conditional formatting. It can also be linked to a macro to perform a task when clicked.

How do you make an in-cell button appear or disappear based on logic?

Use an IF formula to control what text displays in the cell. For example, =IF(MF_Module_On? = 1, “Turn Off”, “”) will show “Turn Off” only when the named cell MF_Module_On? equals 1. This logic can be paired with conditional formatting and an overlaid shape linked to a macro.

What is the purpose of the MF_Module_On? cell?

The MF_Module_On? cell tracks whether the multifamily module is active. A value of 1 means the module is on, and 0 means it is off. This cell drives both the logic for dynamic buttons and the macros that show/hide related tabs.

How are macros used in this setup?

Two macros are created: one to turn the module on (sets MF_Module_On? to 1 and unhides tabs) and one to turn it off (sets MF_Module_On? to 0 and hides tabs). These macros are linked to invisible shapes placed over formatted cells to simulate clickable buttons.

How do you apply conditional formatting to enhance the button visuals?

Go to Home > Conditional Formatting > New Rule > Use a Formula, and enter a formula like =MF_Module_On? = 1. Then format the cell with a red background and white font (or any visual styling) to reflect the button state when the module is active.

What’s the difference between a button and a toggle in this context?

A button performs a single action (e.g., “Turn Off”), while a toggle consists of two adjacent cells (e.g., “On” and “Off”) where each cell activates a different state. Conditional formatting highlights the active selection based on the module status.

Can this technique be applied to other types of models or data?

Yes. This technique is universal and can be applied to any scenario where you want to control visibility, logic, or layout dynamically—such as financial models, dashboards, scenario analysis tools, or user-controlled templates.

Where can I download the example files used in this tutorial?

You can download both the completed and blank formatted Excel files from the tutorial page. The download is offered on a “Pay What You’re Able” basis, including free, and requires just an email to receive the download link.


Version Notes

v1.1

  • Misc. formatting enhancements and cleanups
  • Added version notes tab

v1.0

  • Initial release

About the Author: Spencer Burton is Co-Founder and CEO of CRE Agents, an AI-powered platform training digital coworkers for commercial real estate. He has 20+ years of CRE experience and has underwritten over $30 billion in real estate across top institutional firms.

Spencer also co-founded Adventures in CRE, served as President at Stablewood, and holds a BS in International Affairs from Florida State University and a Masters in Real Estate Finance from Cornell University.

Contact Spencer
by Spencer Burton
Share this entry
  • Share on X
  • Share on LinkedIn
  • Share by Mail
  • Link to Instagram
  • Link to Youtube
https://www.adventuresincre.com/wp-content/uploads/2018/03/dynamic-in-cell-buttons-and-toggles.jpg 1080 1440 Spencer Burton https://adventuresincre.com/wp-content/uploads/2022/04/logo-transparent-black-e1649023554691.png Spencer Burton2020-01-01 00:37:222025-07-02 16:07:33How to Create Dynamic, In-Cell Buttons and Toggles in Microsoft Excel
You might also like
The Circuit Breaker – How to Fix Circular Reference Errors in Excel
A.CRE 101 – Create Smart Drop-Down Menus in Real Estate Modeling
A Few Indispensable Keyboard Shortcuts for Moving Quickly Around Excel
Tutorial: Cómo modelar tasas de crecimiento irregulares para análisis financiero inmobiliario
SUMIF and Other Excel Functions for Real Estate Analysis Using COUNTIFS, SUMIFS, and AVERAGEIFS Excel Functions in Real Estate Underwriting (Updated Dec 2024)
Excel Tip: Copy Worksheets between Identical Models (Updated Mar 2023)
Accelerator - Learn More

Featured Content

  • RE Financial Modeling Training
  • Library of Excel Models
  • Post a Job – It’s Free
  • Master Financial Modeling
  • Technical Interview Guide
  • Definitive Guide to Excel
A.CRE Library of Excel Models

Recent Posts

  • The 2008 Financial Crisis, From the Ground Up: Why We Believed Houses Were Safe
  • Real Estate Equity Waterfall Model – IRR and Equity Multiple Hurdles (Updated June 2026)
  • A.CRE Self Storage Development Model (Updated June 2026)
  • Episode 12 of Multipliers: Ask Why Until the Answer Changes
  • A.CRE Jobs of the Week (Updated 6.22.2026)

Note About Models

Models downloaded from A.CRE may contain errors. Verify formulas/methodology before basing investment decisions on any model here. Read our Terms and Conditions of Use and Disclaimer.

★★★★★

Accelerator Reviews

Search Adventures in CRE

Search Search

Have a Question or Need Help?

Visit our Help Section

Contact Adventures in CRE

  • Visit A.CRE Help
  • Via Email
  • Via LinkedIn

You Might Also Like

  • Real Estate Modeling Courses
  • Real Estate Financial Modeling
  • A.CRE Job Board
  • Careers in Commercial Real Estate
  • Real Estate Education

A.CRE Library of Excel Models

  • Browse Excel Models
  • Login/Register
  • View My Downloads
  • Edit Account Details

Terms, Policies, and Disclaimer

  • Privacy Policy
  • Cookie Policy
  • AI Usage Policy
  • Terms of Use
  • Disclaimer
© 2014 - Present - Copyright - www.AdventuresinCRE.com, LLC | Adventures in CRE | A.CRE
  • Link to Facebook
  • Link to Youtube
  • Link to LinkedIn
  • Link to X
  • Link to Tiktok
  • Link to Instagram
Link to: Watch Me Expand the Home Construction Pro Forma Link to: Watch Me Expand the Home Construction Pro Forma Watch Me Expand the Home Construction Pro Forma Link to: Modeling a Mortgage Loan Assumption Using the All-in-One Link to: Modeling a Mortgage Loan Assumption Using the All-in-One Modeling a Mortgage Loan Assumption Using the All-in-One
Scroll to top Scroll to top Scroll to top