+ Reply to Thread
Results 1 to 25 of 25

trying to convert excel file to online calculator!

  1. #1
    Registered User
    Join Date
    06-15-2015
    Location
    Brighton
    MS-Off Ver
    7
    Posts
    15

    trying to convert excel file to online calculator!

    hey everyone! I've created an excel spreadsheet that does some basic calculations and I want to convert this to an interactive online calculator, can anyone recommend a good conversion program, or does anyone have any tips/advice? thanks a lot in advance, Ellen xxxx

    I only need sheet 1 of the attached file
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: trying to convert excel file to online calculator!

    Javascript?

  3. #3
    Registered User
    Join Date
    06-15-2015
    Location
    Brighton
    MS-Off Ver
    7
    Posts
    15

    Re: trying to convert excel file to online calculator!

    i don't know any javascript, i guess now is the time to learn!

  4. #4
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: trying to convert excel file to online calculator!

    How's this:
    https://jsfiddle.net/r02389Lr/embedded/result/

    PHP Code: 
      var t;
      var 
    workings = function (options) {

          var 
    currentDate = new Date(new Date().toJSON().slice(010));


          function 
    getInterestAmount() {
              return ((
    options.debtOwed options.interestRate daysLate()) / 365.000) || 0
          
    }

          function 
    daysLate() {
              return (((
    options.datePaid || options.dateDue) - options.dateDue) / (1000 60 60 24)) || 0;
          }

          function 
    dailyInterestRate() {
              return (
    getInterestAmount() / daysLate()) || 0;
          }

          function 
    getCompensation() {
              return 
    options.debtOwed 1000 100 options.debtOwed >= 1000 70 40;
          }

          function 
    getTotalOwed() {
              return 
    getCompensation() + getInterestAmount() + parseFloat(options.unpaidDebt || 010);
          }

          return {

              
    daysLatedaysLate(),
              
    interestAmountgetInterestAmount(),
              
    dailyInterestAmountdailyInterestRate(),
              
    compensationgetCompensation(),
              
    totalOwedgetTotalOwed()
          }
      };

      var 
    dataBind = function () {

          var 
    config = {
              
    datePaid: new Date($('*[data-bind="paidDate"]').val()),
              
    dateDue: new Date($('*[data-bind="dueDate"]').val()),
              
    interestRate: ($('*[data-bind="interestRate"]').val() / 100),
              
    debtOwed: $('*[data-bind="debtOwed"]').val(),
              
    unpaidDebt: $('*[data-bind="unpaidDebt"]').val()
          }

          
    = new workings(config);

          $(
    "#compensation").html(t.compensation.toFixed(2));
          $(
    "#interest").html(t.interestAmount.toFixed(2));
          $(
    "#dailyInterest").html(t.dailyInterestAmount.toFixed(2));
          $(
    "#totalInterestComp").html((t.interestAmount t.compensation).toFixed(2));
          $(
    "#totalOwed").html(t.totalOwed.toFixed(2));

      }


      $(
    document).ready(function () {

          $(
    ".date").datepicker().on("changeDate", function (e) {
              
    dataBind();
          });

          $(
    document).on("keyup""table input", function () {
              
    dataBind();
          });
      }); 
    Last edited by Kyle123; 06-16-2015 at 04:28 AM.

  5. #5
    Registered User
    Join Date
    06-15-2015
    Location
    Brighton
    MS-Off Ver
    7
    Posts
    15

    Re: trying to convert excel file to online calculator!

    Thanks so much Kyle123 that's brilliant!

  6. #6
    Registered User
    Join Date
    06-15-2015
    Location
    Brighton
    MS-Off Ver
    7
    Posts
    15

    Re: trying to convert excel file to online calculator!

    I'm looking through your code and I'm new to this so bear with me, but I don't see how you got it to look so nice on the browser! id your html bit not included there?

  7. #7
    Registered User
    Join Date
    06-15-2015
    Location
    Brighton
    MS-Off Ver
    7
    Posts
    15

    Re: trying to convert excel file to online calculator!

    oh actually no worries I found it on the jsfiddle editor, i love this program its so user friendly!

  8. #8
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: trying to convert excel file to online calculator!

    You got everything you need?

  9. #9
    Registered User
    Join Date
    06-15-2015
    Location
    Brighton
    MS-Off Ver
    7
    Posts
    15

    Re: trying to convert excel file to online calculator!

    yeah i think so! i am now trying to edit it to incorporate interest rates as a function of the inputted date rather than the user having to input the interest rate themselves and I have accidently stopped the program from actually producing answers somehow but im working on it!

  10. #10
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: trying to convert excel file to online calculator!

    Dates a a pain in JavaScript since they often include times unless you explicitly prevent them from doing so. If you've got any questions, feel free to post back - if you save your work on jsfiddle and post the link I can see where you're up to and update

  11. #11
    Registered User
    Join Date
    06-15-2015
    Location
    Brighton
    MS-Off Ver
    7
    Posts
    15

    Re: trying to convert excel file to online calculator!

    Hey do you have any ideas about how to deal with the dates?

    this is where I'm at now https://jsfiddle.net/r02389Lr/8/

    basically I want to be able to write a function called getInterestRate which calculates the interest rate from the date input using these interest values and dates:
    3/5/2009 0.500 %
    2/5/2009 1.000 %
    1/8/2009 1.500 %
    12/4/2008 2.000 %
    11/6/2008 3.000 %
    10/8/2008 4.500 %
    4/10/2008 5.000 %
    2/7/2008 5.250 %
    12/6/2007 5.500 %
    7/5/2007 5.750 %

    The dates mean date that interest rate changed.

    So the function would take the input date, and give the corresponding interest rate at that time, added to the base interest rate of 8%.

    I.e. if date input was 05/05/2015, the output interest rate would be 0.500% +8.000% = 8.500%.

    I've been searching google but no dice so far.

    Ellen xxx

  12. #12
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: trying to convert excel file to online calculator!

    In this context, which date would tat relate to? - Wouldn't you need a start date?

  13. #13
    Registered User
    Join Date
    06-15-2015
    Location
    Brighton
    MS-Off Ver
    7
    Posts
    15

    Re: trying to convert excel file to online calculator!

    well this is a more complete list of the base rate interest changes http://www.moneyworld.com/bank-base-rates.htm but i dont think that the program needs to work for debts older than 2007.

    the data above tells you when the interest rate was changed and what it was changed to and it is assumed that the interest rate then stayed the same until the next change date.

    the function would need to look at the input date "date due" and work out between which interest rate change dates this falls, and hence tell you the interest rate on that date.

    This is so hard to explain i feel like the word date isn't even a word anymore!

  14. #14
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: trying to convert excel file to online calculator!

    Is it possible to therefore have multiple interest rates applying should more than one period have passed, or is it just the interest rate at the time the loan/debt was due?

  15. #15
    Registered User
    Join Date
    06-15-2015
    Location
    Brighton
    MS-Off Ver
    7
    Posts
    15

    Re: trying to convert excel file to online calculator!

    yes, the interest rate will also change, so the date would need to be sliced into different sections.

    First step I guess is to assign the dates numerical values.

    Also I have noticed that this isn't working on internet explorer, only on google chrome which is strange, I will look into it

  16. #16
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: trying to convert excel file to online calculator!

    not really, Internet Explorer is crap. Which version are you using and which versions does it need to work in?

    Also, this seems to be an issue with jsFiddle rahter than the code, try running it locally - you can't keep it on jsFiddle

    Also, try: https://jsfiddle.net/r02389Lr/13/

    Though it doesn't tier the rates, that's more complex
    Last edited by Kyle123; 06-16-2015 at 10:10 AM.

  17. #17
    Registered User
    Join Date
    06-15-2015
    Location
    Brighton
    MS-Off Ver
    7
    Posts
    15

    Re: trying to convert excel file to online calculator!

    I'm not sure which version it is! how can i find out? I guess it needs to work in all versions because the idea of the project is that it will go on the company's website as a free debt calculator for people to use with the hope of bring in business.

    I know this will make me sounds like such an idiot, but I'm new to coding (2nd day on the job!!), how can i run it locally, as there are 2 parts to the code, the HTML bit and the Javascript bit?

    Thanks I will have a look at the link

  18. #18
    Registered User
    Join Date
    06-15-2015
    Location
    Brighton
    MS-Off Ver
    7
    Posts
    15

    Re: trying to convert excel file to online calculator!

    you're really fast at this! does this assume the rate stays the same since the debt has become due?

  19. #19
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: trying to convert excel file to online calculator!

    I hope so, it's my job

    Yes, I'd need to know how the calculation works before adding the tiers, if you upload a workbook with the desired logic, I'll have a look

  20. #20
    Registered User
    Join Date
    06-15-2015
    Location
    Brighton
    MS-Off Ver
    7
    Posts
    15

    Re: trying to convert excel file to online calculator!

    Hey Kyle, So I've made a new excel sheet which does everything, including calculating the tiered interest.

    Do you know how one would make a web form which can take input data, put it into a spreadsheet, and then produce output values?


  21. #21
    Registered User
    Join Date
    06-15-2015
    Location
    Brighton
    MS-Off Ver
    7
    Posts
    15

    Re: trying to convert excel file to online calculator!


  22. #22
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: trying to convert excel file to online calculator!

    Do you know how one would make a web form which can take input data, put it into a spreadsheet, and then produce output values?
    That depends what you mean. To write to a workbook, you'd usually need a server side language like PHP, C#, Python etc - it's a bit more involved than just JavaScript. If you mean that you want to put values into the spreadsheet from a webform, run the Excel calculations and return the result, then no, it's not. Firstly, you'd need to be running a windows server - you can't run Excel on Linux so that would rule out about 70% of hosing solutions and put your costs up, but secondly, and more importantly, Excel is not supported in a server Environment as it can't handle simultaneous connections and MS explicitly tell you not to do it.

  23. #23
    Registered User
    Join Date
    06-15-2015
    Location
    Brighton
    MS-Off Ver
    7
    Posts
    15

    Re: trying to convert excel file to online calculator!

    Ok I understand, I guess I will have to try and code up the tiered interest rate stuff in Javascript then! I was trying to avoid it as it will be very difficult!!

  24. #24
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: trying to convert excel file to online calculator!

    Try this: https://jsfiddle.net/r02389Lr/19/

    Wants refactoring a bit, but you should be able to follow the logic. To note, it's important that the dates and interest rates are put in descending order as in your spreadsheet.

    Actually there's a bug in this that isn't right if the due date is later than the last interest rate - I'll fix in the morning
    Last edited by Kyle123; 06-17-2015 at 12:55 PM.

  25. #25
    Registered User
    Join Date
    06-15-2015
    Location
    Brighton
    MS-Off Ver
    7
    Posts
    15

    Re: trying to convert excel file to online calculator!

    Thanks a lot kyle

+ 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. [SOLVED] Input Data into Online Calculator
    By rdelgadillo in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-27-2014, 07:37 PM
  2. [SOLVED] Open online excel file - batch file
    By no_Fate in forum Excel General
    Replies: 2
    Last Post: 07-10-2014, 05:36 PM
  3. Replies: 0
    Last Post: 04-12-2013, 07:38 AM
  4. Creating a formula from an online calculator
    By bobson in forum Excel General
    Replies: 5
    Last Post: 04-17-2012, 08:21 AM
  5. How To Use My Excel Calculator Online?
    By RandyStacyE in forum Excel General
    Replies: 1
    Last Post: 04-23-2007, 10:04 PM

Tags for this Thread

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