+ Reply to Thread
Results 1 to 32 of 32

Simple Calculator

  1. #1
    Forum Contributor
    Join Date
    09-29-2014
    Location
    Montreal, Canada
    MS-Off Ver
    2013
    Posts
    222

    Simple Calculator

    I would like to make a simple calculator in Excel2013 and I know there are many on the web but I want to make my own if possible to practice and configure it the way I want it

    The attached sheet has a sample on what I practice. When I click for example on m (meter) cell and change its value say to 5, all cell above and below the 1m cell change however I want this to happen when I change the value in any cell, like if click on ft (feet) and type a new number there it should change the values in all cell

    Is this something simple or very complicated to do?
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Simple Calculator

    You may need to explore the Excel Convert Function. https://exceljet.net/excel-functions...nvert-function

    Then you need to use a simple Macro. I will make a start for you.

    I have made this work for Lengths.

    You can use this link to create your other conversions. https://www.tlc-direct.co.uk/Technic...lculators.html

    Right Click on the sheet name at the bottom of excel and select view code.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by mehmetcik; 02-11-2019 at 03:45 PM.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Forum Contributor
    Join Date
    09-29-2014
    Location
    Montreal, Canada
    MS-Off Ver
    2013
    Posts
    222

    Re: Simple Calculator

    Thanks so much for your time, I will print and review the attached sheet and come back with my comments.

    I went to the Excel Convert Function page but I didn’t see any download button. Perhaps I will have to register first?

    Much appreciated
    Nicolas

  4. #4
    Forum Expert Roel Jongman's Avatar
    Join Date
    03-28-2015
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    1,483

    Re: Simple Calculator

    I use simple conversion table.. instead of vba..

    table is on same sheet as converter now but can also be on separate sheet out of sight.

    I think it is possible to put it in a formula but am to tired to think it up
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    09-29-2014
    Location
    Montreal, Canada
    MS-Off Ver
    2013
    Posts
    222

    Re: Simple Calculator

    Thanks Roel, I dont see any table on the same sheet, perhaps I miss something?

  6. #6
    Forum Contributor
    Join Date
    09-29-2014
    Location
    Montreal, Canada
    MS-Off Ver
    2013
    Posts
    222

    Re: Simple Calculator

    Sorry I was looking at the wrong file, now I see the table

    Is it possible to give me some explanations on the table?

    Thanks

  7. #7
    Forum Expert Roel Jongman's Avatar
    Join Date
    03-28-2015
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    1,483

    Re: Simple Calculator

    The table simply shows the conversions each column represents 1 unit so 1 mm and reading down you see how that 1mm is 0,1 cm etc..

    The index and match match formula does nothing more than look up the conversion number for the chosen measurements. where the from unit is in columns and the to unit is in rows and where they cross eachother is the conversion multiplier. to get from a to b

  8. #8
    Forum Contributor
    Join Date
    09-29-2014
    Location
    Montreal, Canada
    MS-Off Ver
    2013
    Posts
    222

    Re: Simple Calculator

    Thank you Roel, I will study the table and see how it can help me

  9. #9
    Forum Contributor
    Join Date
    09-29-2014
    Location
    Montreal, Canada
    MS-Off Ver
    2013
    Posts
    222

    Re: Simple Calculator

    Thanks Roel for your help, I studied the .xlsx you sent me and it looks like what I want. I can make my own drop down list and I should be ok with the formulas but my question for now is:

    What is the purpose of the list between columns B&C, rows 5-10? The formula does not change for each row so I just wonder.

    Thanks

  10. #10
    Forum Expert Roel Jongman's Avatar
    Join Date
    03-28-2015
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    1,483

    Re: Simple Calculator

    the formula in those ranges do change as row() gives a different number each line so the Hlookup looks up values in another columns The ROW() function trick can be helpfull if you need a different number on each row but dont want to type manually the number.

    The formulas have no real purpose if you only want to show 1 chosen conversion. You can leave them out.

    I also tinkered with the formulas a bit and was able to comeup with a simpeler lookup table. Because this formula converts every option to the smallest unit (mm) and then converts back to the chosen "to unit"

    have a look at the new formula in the sheet with the new simplefied lookup table.
    Attached Files Attached Files

  11. #11
    Forum Contributor
    Join Date
    09-29-2014
    Location
    Montreal, Canada
    MS-Off Ver
    2013
    Posts
    222

    Re: Simple Calculator

    I will print both Vlookup/Hlookup formulas and study them to refresh my memory with all the parameters involved.

    Is it possible to have the dropdown lists expended? Like instead clicking to select an item, all items are visible. Looks like they are locked?

    For sure what you have shown looks like is what I want. I just try to better understand how the formulas work.

    Much appreciated

  12. #12
    Forum Contributor
    Join Date
    09-29-2014
    Location
    Montreal, Canada
    MS-Off Ver
    2013
    Posts
    222

    Re: Simple Calculator

    mehmetcik,

    I would like to explore your code since it looks like an easier alternative but there is a code error somewhere because when I input 2 meters in the drop down list or change other values the results are incorrect.

    The constants in the code are correct so the code error is elsewhere within the code.

    Also how can I change the drop down list?

    Thank you
    Last edited by jeffreybrown; 02-12-2019 at 09:02 PM. Reason: Removed unnecesary full quote! It's just clutter.

  13. #13
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Simple Calculator

    Hi

    1. I found a bug.

    Try changing the Macro to

    Please Login or Register  to view this content.

    2. The Dropdown List is data validation.

    Select cell D5, Select the Data Tab and then Data Validation.

    You can then edit the list.
    Last edited by mehmetcik; 02-13-2019 at 12:29 PM.

  14. #14
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Simple Calculator

    I played with the code and inserted the Code for mass

    Please Login or Register  to view this content.

  15. #15
    Forum Contributor
    Join Date
    09-29-2014
    Location
    Montreal, Canada
    MS-Off Ver
    2013
    Posts
    222

    Re: Simple Calculator

    I will study with my rusty experience the code and come back with the results. Hope all will be fine

    Thanks for your time

  16. #16
    Forum Contributor
    Join Date
    09-29-2014
    Location
    Montreal, Canada
    MS-Off Ver
    2013
    Posts
    222

    Re: Simple Calculator

    Works very well now but when I add the “mass” code I get
    For Length in both columns I get in
    For mass I get in both columns g,kg,Ounces,Pounds,Stones,in

    I think I can fix this problem myself tonight or tomorrow

    Is there any way to change the font size when I view the Code? I use a laptop and I find the code reading king of difficult

    Nicolas

  17. #17
    Forum Contributor
    Join Date
    09-29-2014
    Location
    Montreal, Canada
    MS-Off Ver
    2013
    Posts
    222

    Re: Simple Calculator

    I have been not successful to fix the problem with the “mass” code. When you have a chance let me know

    Nicolas

  18. #18
    Forum Contributor
    Join Date
    09-29-2014
    Location
    Montreal, Canada
    MS-Off Ver
    2013
    Posts
    222

    Re: Simple Calculator

    Forgot to mention that I fixed the fonts inside the VBA Editor

  19. #19
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Simple Calculator

    I didn't see that problem.
    Attached Files Attached Files

  20. #20
    Forum Contributor
    Join Date
    09-29-2014
    Location
    Montreal, Canada
    MS-Off Ver
    2013
    Posts
    222

    Re: Simple Calculator

    I can see on the new download the code works well. Although I was careful perhaps I did something wrong so I will try again (Sunday I will have more time).

    I will also follow your instructions to use the “Useful Code” you included with the download. No idea what’s for but guess I will find out

    Nicolas

  21. #21
    Forum Contributor
    Join Date
    09-29-2014
    Location
    Montreal, Canada
    MS-Off Ver
    2013
    Posts
    222

    Re: Simple Calculator

    Sorry mehmetik I guess I did something wrong again but following your instructions for the “Useful Code” I get the message “Compile error, Invalid parameters” and I have a lot of red lines on the code.
    Your instructions are (my questions on the right)::
    1.Select the developer tab – Is this on a new Excel project?
    2. Select view and then project explorer
    3. Select your project – You mean the last file you sent me?
    4. Select insert and then module
    5. Paste this code in the module that opens and close it.
    6. Select the developer tab
    7. Select Macros – I see no Macros there, the list is empty
    8. Select Test and then run
    9. Right Click On Your Sheet Name At the Bottom Of Excel and Select View Code
    Paste this code in the module that opens and close it. –But I did this on step 5 above

    I attach the Excel I did the above

    Nicolas

  22. #22
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Simple Calculator

    You misunderstood.

    Look at My Post #21.

    To see the code, right click on the sheetname at the bottom of excel and select view code.

  23. #23
    Forum Contributor
    Join Date
    09-29-2014
    Location
    Montreal, Canada
    MS-Off Ver
    2013
    Posts
    222

    Re: Simple Calculator

    Your last post is #19 and regarding the problem you say you didn’t see any and I replied and said you are correct. Then you have a file attached which I opened and you have this “Useful Code” inside that file with instructions of what to do to install that code.

    On the last file you sent me there is a tab before Sheet1 called (Useful Code). Is this code for me to install?

    On Sheet1 of the same file I see the code

  24. #24
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Simple Calculator

    Useful code is my list of Useful code that I use to write Macros.

    The Sheet is created automatically by a Macro in my personal workbook to help me write Macros.

  25. #25
    Forum Contributor
    Join Date
    09-29-2014
    Location
    Montreal, Canada
    MS-Off Ver
    2013
    Posts
    222

    Re: Simple Calculator

    Now I understand, I thought the Useful Code was something I could incorporate into the Sheet1 code.

    The Sheet1 code is all I need to keep going ahead with my small project. I will try to add more cases for other conversion units and hopefully all will be fine.

    If I stumble I will come back here to ask for your excellent help and patience or perhaps I should start a new thread?.

    I don’t know if it’s right or not but I will mark this thread as solved since for now my current questions have been answered

    Nicolas

  26. #26
    Forum Contributor
    Join Date
    09-29-2014
    Location
    Montreal, Canada
    MS-Off Ver
    2013
    Posts
    222

    Re: Simple Calculator

    Quote Originally Posted by mehmetcik View Post
    You misunderstood.

    Look at My Post #21.

    To see the code, right click on the sheetname at the bottom of excel and select view code.
    I have done some additions to your code but now if I enter 1 to change any unit my 1 becomes 0.01 and all results are wrong.
    This happened after I added the conversions to the case “Area”. Perhaps because there are so many zeros in the "Area" case?
    Please see the attached

    Nicolas

  27. #27
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Simple Calculator

    Please Login or Register  to view this content.

  28. #28
    Forum Contributor
    Join Date
    09-29-2014
    Location
    Montreal, Canada
    MS-Off Ver
    2013
    Posts
    222

    Re: Simple Calculator

    Unfortunately I get the same results again, when I enter 1 I get 0.01 and all conversions are wrong as per attached.

    Nicolas

  29. #29
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Simple Calculator

    Hi oskar,

    There is already a calculator and Conversion tool that you can buy the code for. See PUP7 and buy the code. It is one of my favorite add-ins and the code is excellent.
    http://spreadsheetpage.com/index.php/pupv7/home
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  30. #30
    Forum Contributor
    Join Date
    09-29-2014
    Location
    Montreal, Canada
    MS-Off Ver
    2013
    Posts
    222

    Re: Simple Calculator

    Quote Originally Posted by MarvinP View Post
    Hi oskar,

    There is already a calculator and Conversion tool that you can buy the code for. See PUP7 and buy the code. It is one of my favorite add-ins and the code is excellent.
    http://spreadsheetpage.com/index.php/pupv7/home
    Thanks Marvin for the tip but this utility is much more than I need and at US$60 (including the code) it’s pretty costly however for someone who can use all its features it may worth the money.
    I only need the calculator and even that I do it as a hobby, really I don’t have much use for it.

  31. #31
    Forum Contributor
    Join Date
    09-29-2014
    Location
    Montreal, Canada
    MS-Off Ver
    2013
    Posts
    222

    Re: Simple Calculator

    Quote Originally Posted by mehmetcik View Post
    Please Login or Register  to view this content.
    I just discovered that if I input my value as 1.0 instead as 1 the code works.

    Nicolas

  32. #32
    Forum Contributor
    Join Date
    09-29-2014
    Location
    Montreal, Canada
    MS-Off Ver
    2013
    Posts
    222

    Re: Simple Calculator

    Quote Originally Posted by Roel Jongman View Post
    I use simple conversion table.. instead of vba..

    table is on same sheet as converter now but can also be on separate sheet out of sight.

    I think it is possible to put it in a formula but am to tired to think it up
    Hi Roel

    I try to make a simple interface like the attached picture where I can click in the left column to select one of the available units and by clicking let’s say on the Length it is reading from Sheet1 or wherever the Length formulas and tables are located.

    But when I put in front of the formula Sheet1! it does not work, it says #N/A

    If it’s possible / easy to do it, please let me know

    Thanks
    Attached Images Attached Images

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Simple way to Calculator Volatility?
    By QuantEdge in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 08-29-2017, 12:47 PM
  2. Wanting a simple calculator
    By hopper10 in forum Excel General
    Replies: 1
    Last Post: 03-22-2017, 01:29 PM
  3. [SOLVED] Simple loan Calculator
    By zplugger in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-01-2017, 02:41 PM
  4. [SOLVED] Simple commission calculator
    By maxcong in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-21-2013, 04:33 AM
  5. Simple Tax/N.I calculator
    By john.b in forum Excel General
    Replies: 5
    Last Post: 07-08-2012, 10:01 AM
  6. Simple Financial Calculator
    By Pulsus in forum Tips and Tutorials
    Replies: 10
    Last Post: 06-06-2012, 02:04 AM
  7. Simple Calculator Problem
    By Wheelz in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-09-2006, 02:41 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1