How to Make a Calculator in Excel (with Easy Steps) - ExcelDemy (2024)

The calculator is a part and parcel of our daily life. We can use the calculator directly inside Excel without switching to other applications or manual calculations. In this article, we present 4 step by step procedures to make a calculator in Excel in a detailed manner.

How to Make a Calculator in Excel (with Easy Steps)

The process of making a calculator in Excel involves creating an outline and then attaching code to it. And then finalize the calculator by testing them with various numbers. For avoiding any compatibility issues, use MS Excel 365 edition.

Step 1: Create Calculator Outline

Before we delve into creating the calculator button and assign various codes to it, we must first create the outline of the calculator beforehand.

  • To begin with, we need to create the outline of our calculator first.
  • For this, we arranged the input and the output cells as shown below.

How to Make a Calculator in Excel (with Easy Steps) - ExcelDemy (1)

Read More: How to Create a Calculator Using Macros in Excel

Step 2: Input Command Button

After creating the basic outline, now we can create various buttons for the calculator using the command button.

  • To add a command button, go to the Developer > Insert > Command Button (ActiveX Control).

How to Make a Calculator in Excel (with Easy Steps) - ExcelDemy (2)

  • After then you will notice that there is a new draw icon.
  • Using that icon, draw the shape of your Command Button box.

How to Make a Calculator in Excel (with Easy Steps) - ExcelDemy (3)

  • Here we draw a medium-sized box and then release the cursor.
  • The command box right now has a caption within it. We need to alter the caption.

How to Make a Calculator in Excel (with Easy Steps) - ExcelDemy (4)

  • To alter the caption, right-click on the box and select Properties from the context menu.

How to Make a Calculator in Excel (with Easy Steps) - ExcelDemy (5)

  • In the properties menu, click on the caption and then type “+”.
  • Click on the cross in the corner of the box to close it.

How to Make a Calculator in Excel (with Easy Steps) - ExcelDemy (6)

  • Right after this, we will notice that the command button is now present with a modified caption.

How to Make a Calculator in Excel (with Easy Steps) - ExcelDemy (7)

  • Repeat the same process for the rest of the buttons shown below.
  • The different buttons will denote different operations.
  • Clear All button will clear everything(the inputs and outputs)
  • The Clear Output will clear only the output value so that you can restart the operation immediately.

How to Make a Calculator in Excel (with Easy Steps) - ExcelDemy (8)

  • Hence we completed the button layout in Excel for now.

Step 3: Create VBA Macro and Attach to the Buttons

Now we can create VBA codes and attach them to individual buttons.

  • For this, right-click on the first button created and then select View Code from the context menu.

How to Make a Calculator in Excel (with Easy Steps) - ExcelDemy (9)

  • There will be a code editor window where you need to type the below code.
Private Sub CommandButton1_Click()Range("D6") = Range("C4").Value + Range("D6").Value + Range("E4").ValueEnd Sub

How to Make a Calculator in Excel (with Easy Steps) - ExcelDemy (10)

  • Now, move on to the next button “-”.
  • Right-click on it and select View Code from the context menu.

How to Make a Calculator in Excel (with Easy Steps) - ExcelDemy (11)

  • In the window, type the below code and then close it using the close or cross icon corner of the window.
Private Sub CommandButton3_Click()If Range("D6").Value = 0 ThenRange("D6") = Range("C4").Value - Range("E4").ValueElseRange("D6") = Range("D6").Value - Range("E4").ValueEnd IfEnd Sub

How to Make a Calculator in Excel (with Easy Steps) - ExcelDemy (12)

  • Repeat the same procedure for the multiplication button and enter the below code for that button.
Private Sub CommandButton2_Click()Range("D6") = Range("C4").Value * Range("E4").ValueEnd Sub

How to Make a Calculator in Excel (with Easy Steps) - ExcelDemy (13)

  • Repeat the same procedure for the division button and enter the below code for that button.
Private Sub CommandButton4_Click()Range("D6") = Range("C4").Value / Range("E4").ValueEnd Sub
  • Repeat the same procedure for the Clear All button and enter the below code for that button.
Private Sub CommandButton5_Click()Range("C4").ClearContentsRange("E4").ClearContentsRange("D6").ClearContentsEnd Sub
  • For Clear Output button, insert the code below:
Private Sub CommandButton6_Click()Range("D6").ClearContentsEnd Sub

How to Make a Calculator in Excel (with Easy Steps) - ExcelDemy (14)

  • After entering all of that code, we can see that the buttons are now fully functioning and ready to put into operation.

Step 4: Test Calculator Operation

Every operation or project needs specific testing in order to make them reliable. Hence we need to test out the calculator to make sure that the calculator is working perfectly.

  • As we now have the buttons, we can now use them to test various mathematical operations.
  • For this, enter 110 and 10 as Input 1 and Input 2 in cells C4 and E4
  • To estimate the sum of them, click on the “+” icon.

How to Make a Calculator in Excel (with Easy Steps) - ExcelDemy (15)

  • After clicking on the + sign, the output will be shown as 120.

How to Make a Calculator in Excel (with Easy Steps) - ExcelDemy (16)

  • Now, we want to conduct a new operation, for this clears the output values by pressing the Clear Output option.

How to Make a Calculator in Excel (with Easy Steps) - ExcelDemy (17)

  • After this, having the same input as before, click on the icon.
  • The output will be shown as 100 in cell D6.

How to Make a Calculator in Excel (with Easy Steps) - ExcelDemy (18)

Observing these examples, we can ascertain that the calculator is working as expected.

Download Practice Workbook

Download this practice sheet to practice while you are reading this article.

How to Make a Calculator.xlsm

Conclusion

I hope all of these simple methods mentioned above will now help you to apply them in your Excel spreadsheets when you have to make a calculator. For this problem, a workbook is available to download where you can practice these methods. Feel free to ask any questions or feedback through the comment section.

Related Articles

  • How to Use Excel VBA Userform
  • Excel VBA: Create a Progress Bar While Macro Is Running
  • How to Create Cascading Combo Boxes in Excel VBA User Form
Get FREE Advanced Excel Exercises with Solutions!
How to Make a Calculator in Excel (with Easy Steps) - ExcelDemy (2024)

References

Top Articles
Light Rye Bread (no-knead, overnight recipe) | Moorlands Eater
Soft and Fluffy Sweet Marbled Bread Recipe (Easy to Make!)
Skycurve Replacement Mat
Unity Stuck Reload Script Assemblies
Amtrust Bank Cd Rates
Chelsea player who left on a free is now worth more than Palmer & Caicedo
Craigslist In South Carolina - Craigslist Near You
Where's The Nearest Wendy's
Morgan Wallen Pnc Park Seating Chart
Vardis Olive Garden (Georgioupolis, Kreta) ✈️ inkl. Flug buchen
Athens Bucket List: 20 Best Things to Do in Athens, Greece
Slushy Beer Strain
Colts seventh rotation of thin secondary raises concerns on roster evaluation
Animal Eye Clinic Huntersville Nc
The Shoppes At Zion Directory
Accuradio Unblocked
Hoe kom ik bij mijn medische gegevens van de huisarts? - HKN Huisartsen
Otterbrook Goldens
Mikayla Campinos Laek: The Rising Star Of Social Media
Is The Yankees Game Postponed Tonight
Sussyclassroom
Craigslist Apartments Baltimore
Brbl Barber Shop
Shoe Station Store Locator
Keshi with Mac Ayres and Starfall (Rescheduled from 11/1/2024) (POSTPONED) Tickets Thu, Nov 1, 2029 8:00 pm at Pechanga Arena - San Diego in San Diego, CA
UAE 2023 F&B Data Insights: Restaurant Population and Traffic Data
Uno Fall 2023 Calendar
Why comparing against exchange rates from Google is wrong
Warn Notice Va
Http://N14.Ultipro.com
In Branch Chase Atm Near Me
Tenant Vs. Occupant: Is There Really A Difference Between Them?
Reading Craigslist Pa
拿到绿卡后一亩三分地
Winco Money Order Hours
Is The Nun Based On a True Story?
Registrar Lls
Emily Tosta Butt
Miami Vice turns 40: A look back at the iconic series
Cl Bellingham
Wordle Feb 27 Mashable
Martha's Vineyard – Travel guide at Wikivoyage
Nu Carnival Scenes
Cleveland Save 25% - Lighthouse Immersive Studios | Buy Tickets
Chubbs Canton Il
Victoria Vesce Playboy
Richard Mccroskey Crime Scene Photos
Mytmoclaim Tracking
How to Do a Photoshoot in BitLife - Playbite
Tamilblasters.wu
Subdomain Finer
Att Corporate Store Location
Latest Posts
Article information

Author: Amb. Frankie Simonis

Last Updated:

Views: 5872

Rating: 4.6 / 5 (56 voted)

Reviews: 87% of readers found this page helpful

Author information

Name: Amb. Frankie Simonis

Birthday: 1998-02-19

Address: 64841 Delmar Isle, North Wiley, OR 74073

Phone: +17844167847676

Job: Forward IT Agent

Hobby: LARPing, Kitesurfing, Sewing, Digital arts, Sand art, Gardening, Dance

Introduction: My name is Amb. Frankie Simonis, I am a hilarious, enchanting, energetic, cooperative, innocent, cute, joyous person who loves writing and wants to share my knowledge and understanding with you.