Doing mathematical formulas with numbers stored as strings

Hi Everybody.
I know I must be doing something stupid here, but I just can't see it.
I'm just trying to do a simple maths formula of one number divide by another. However, one of the numbers is stored as a string.
I have tried  'X' / Ccur ({'String'}) and even done a seperate formula that succesfully converts the string to a number and  then try 'X' /  ({'conversion formula'}) and still no luck.
What am I missing and can anybody help please?
Thanks
Graham

Thanks both.
Works perfectly. Didn't see the ToNumber conversion in the choices available and have not used it before.
I'll also provide better descriptions as well in the future.
Regards
Graham
Points awarded accordingley  :O)

Similar Messages

  • XML validation with DTD stored in String object

    Does anyone know if this is plausible......
    I am trying to validate some XML with a DTD... easy enough, right? The catch is that the dtd is NOT stored in a file somewhere and is also not declared in the XML to be validated. It is stored in a String object (as is the XML file to be validated).
    To clarify - I want to do something like this... but not sure how to incorporate the DTD.
    String dtd = // dtd definition here
    String xml = // xml text here (no URI at the top)
    SAXParserFactory factory = SAXParserFactory.newInstance();
    SAXParser parser = factory.newSAXParser();
    DefaultHandler handler = new DefaultHandler();  // DTD handler??
    parser.parse(new InputSource(new StringReader(xml.toString())), handler);any help would be greatly appreciated.
    thanks in advance,
    Terrance

    I guess it makes the most sense to make the dtd local to the xml. Therefore I would only have one string with both the xml contents and dtd contents. That is how I am going to approach this unless I hear something different.

  • Help Sorting array of strings with numbers in them

    Hello I need to sort an array of Strings of numbers. The order is not what I want it to be. instead of 1, 5, 20 it will go 1, 20, 5.
    I did a google search for this and found some code that could fix this. The only problem is I tried using it as a method in my program and am getting a compile-time error that I'm not sure how to fix.
    C:\Documents and Settings\Owner\Desktop\stringcompare.java:18: '(' or '[' expected
                new Comparator<String>()
                                    ^I'm not sure what to do here. Any help would appreciated.

    import java.io.*;
    class MyProgram{
    //This is my old bubble sort method which screws up with numbers
    public static String[] sort( String[] points)
              boolean keepGoing = true;
              while(keepGoing == true){
                   keepGoing = false;
                   for(int i = 0; i < points.length - 1; i ++)
                        if(points.compareToIgnoreCase(points[i + 1]) < 0)
                             String temp = points[i];
                             points[i] = points[i + 1];
                             points[i + 1] = temp;
                             keepGoing = true;
              return points;
    //This method reads a pre-existing text file
    public static String[] readPoints() throws IOException
              FileReader file = new FileReader("points.txt");     
              BufferedReader in = new BufferedReader(file);
              String temp;                
              String[] list = new String[100];     
              int i = 0;
              while (i < list.length)                    
                   temp = in.readLine();
                   if (temp != null)
                        list[i] = temp;                    
                   else
                        list[i] = " ";
                   i++;
              in.close();                              
              return list;
    //rewrites file after being sorted
         public static void savePoints(String[] points) throws IOException
              FileWriter file = new FileWriter("points.txt");
              BufferedWriter out = new BufferedWriter(file);
              int i = 0;
              while (i < points.length)          // while the end of file is not reached
                   out.write(points[i]) ;
                   out.newLine();
                   i++;
              out.flush();
              out.close();
    public static void main(String[]args) throws Exception{
    String[]points = new String [100];
    points = readPoints();
    points = sort(points);
    savePoints(points);
    for(int i = 0; i < points.length - 1; i++)
    System.out.println(points[i]);
    The problem is that it doesn't sort as I would like it and I'm not sure how to get the comparator to work properly.
    Edited by: myol on May 31, 2008 4:21 PM
    Edited by: myol on May 31, 2008 4:23 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Numbers hangs / does not respond with Lion OS 10.7

    I have the latest version of Numbers but it does not work with Lion OS X: Numbers hangs / stop responding on opening existing files or creating new files. When I run Numbers "Template chooser" appears, I chose an existing file, then the program reports "Progress... Opening..." and hangs. Your help will be greatly appreciated!

    Thanks
    (1) If you are annoyed by the alternate account you may remove it but it may be useful if you have other questions about an odd behavior.
    (2) Now, it's clear that the problem is in the main set of files, those shared by every accounts.
    I'm not really at ease because I'm not sure of the way apps bought thru the MAS are installed on the HD.
    I will ask you to apply two tasks :
    (a) run the application "FontBook" (from Applications) and ask it to scan the system in search of corrupted fonts as well as duplicate ones.
    (b) Go to : http://www.titanium.free.fr/
    and download the free Onyx dedicated to Lion (I know, it's a beta version)
    Run it to :
    check/repair permissions
    clean most of the caches used on the machine.
    With a bit of luck, you will get a normal behavior.
    May you also, for my own information, tell me :
    (I) if there is such a folder (Frameworks) on your machine :
    On yours, I guess that "Bibliothèque" is spelled "Library"
    (II) if Numbers is stored in the folder "Applications" or in a folder "Applications:iWork '09"
    Yvan KOENIG (VALLAURIS, France) lundi 25 juillet 2011 16:41:26
    iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8
    Please : Search for questions similar to your own before submitting them to the community
    To be the AW6 successor, iWork MUST integrate a TRUE DB, not a list organizer !

  • Hi I'm a total novice, as you will see. But Iam trying to use template of an employee schedule but when I try to add extra columns it does not add the preset formula with it, so it works out total hours and total pay?   If any one can help please.

    Hi I'm a total novice, as you will see. But Iam trying to use template of an employee schedule but when I try to add extra columns it does not add the preset formula with it, so it works out total hours and total pay?   If any one can help please before I throw it through the window!

    Grum12 wrote:
    Hi I'm a total novice, as you will see. But Iam trying to use template of an employee schedule but when I try to add extra columns it does not add the preset formula with it, so it works out total hours and total pay?   If any one can help please before I throw it through the window!
    Hi Grum,
    If the formulas aren't filling to the new column, you must have changed something in the template since you first opened it. Numbers is rather fussy about filling row content in columns as they are added. Only rows with the same expression in every Body Column will fill when a column is added. Just as an experiment, start a new Employee Schedule document from the Template Chooser and then add a column by clicking the Add Column handle in the upper right corner of the table. If that works, as it should, then think about what might have changed in your working document to disconnect that feature. Maybe we can figure it out together.
    Jerry

  • Executing an Arithmatic Formula stored as String

    Hi All,
    Please help,
    I have similar problem with Mr. Vijayakumar V.
    I need to get result value of an arithmatic formula which stored as string.
    ex:
    zform = '( A / 2 ) + ( B * 1.25 + 2 )'.
    if I have A = 10, and B = 4.
    I do expect the final result to be : 12
    for ( 5 + 7 ) = 12
    Is there any simple way to do this or
    Is there built in function in ABAP to deal with something like this?
    Thank you,

    Hi Oki,
    You can solve your problem by generating subroutine at runtime.
    Please look at sample code below:
    REPORT  z_jr05.
    DATA: code(72) OCCURS 10,
          prog(8),
          msg(120),
          lin(3),
          wrd(10),
          off(3),
          var_string(50),
          p_result  TYPE i.
    var_string  = 'temp_result = ( A * B ) + 199.'.
    REPLACE ALL OCCURRENCES  OF'A' IN var_string WITH '10'.
    REPLACE ALL OCCURRENCES  OF'B' IN var_string WITH '11'.
    APPEND 'PROGRAM SUBPOOL.'                  TO code.
    APPEND 'FORM HITUNG changing p_result.'    TO code.
    APPEND 'data: temp_result type i.'         TO code.
    APPEND  var_string                         TO code.
    APPEND 'p_result = temp_result.'           TO code.
    APPEND 'ENDFORM.'                          TO code.
    GENERATE SUBROUTINE POOL code NAME prog
            MESSAGE msg LINE lin
            WORD wrd    OFFSET off.
    IF sy-subrc <> 0.
      WRITE: / 'Error during generation in line', lin,
      / msg,
      / 'Word:', wrd, 'at offset', off.
    ELSE.
      WRITE: / 'The name of the subroutine pool is', prog.
      SKIP 2.
      PERFORM hitung IN PROGRAM (prog) CHANGING p_result.
      WRITE p_result.
    ENDIF.
    Regards,

  • Numbers does not open with the main user after installing mountain lion. It works flawlessly when I use the second account on my mac. What got corrupted in the admin-account, something in the user-library? How can I fix it? I´m kinda desperate...

    Numbers does not open with the main user after installing mountain lion. It works flawlessly when I use the second account on my mac. What got corrupted in the admin-account, something in the user-library? How can I fix it? I´m kinda desperate... (the same happens with the other iWork-Apps!)
    Looking forward to hearing from somebody with a littlemore expertise than me, Chris

    you can remove preferences files by navigating to the Preferences folder for your user as follows:
    0) Quit ALL iWork apps (Keynote, Pages and Numbers)
    1) from the Finder select the menu item "Go > Go To Folder…".  This will bring up a dialog:
    2) enter the path "~/Library/Preferences" (no double quotes)
    3) find the files:
    com.apple.iWork.Keynote.plist
    com.apple.iWork.Numbers.plist
    com.apple.iWork.Pages.plist
    and move these to the trash.  I would NOT empty until later.
    4) restart Numbers

  • With my new macbook I attempted to open an older spreadsheet and get the following error message:  "This spreadsheet cannot be opened because ti is too old.  To open it, save it with numbers '09 first"  So how does one do this when I only have ver3.1?

    With my new macbook I attempted to open an older spreadsheet and get the following error message:  "This spreadsheet cannot be opened because ti is too old.  To open it, save it with numbers '09 first"  So how does one do this when I only have ver3.1?

    Numbers 3.x can only open Numbers '09 and later.  You will need Numbers '09 to open Numbers '08 files.
    If it is a single file (or only a few) you can email me and I will open and convert then email back.  My email address is in the "Biography" of my profile.
    You may have Numbers '09 installed.  Look in the folder "/Applications/iWork '09"  if Numbers is in that folder launch it, open the file you tried to open, and save.  Then you should be able to open in Numbers 3.x

  • In iWork 09, Numbers, how do I replace a formula with calculated results for a whole column?

    I have a rather large Numbers spreadsheet.  I have used a formula to create a new column of information.  I now want to replace the formula with the actual results calculated by that formula for each cell in that column, so that I can delete some of the other columns.  How do I do that?

    Copy the cells with the results, then select the destination cell, and use the menu item "Edit > Paste Values".
    You may want to paste to a different location in case you need the source data or formulas in the future.
    Regards,
    Wayne

  • How to sent importet RAW files into the cloud? The files was importet from Canon EOS via camera adapter to the iPad. The Files was stored in the folder importet. But the files does not sync with photostream.

    How to sent importet RAW files into the cloud? The files was importet from Canon EOS via camera adapter to the iPad. The Files was stored in the folder importet. But the files does not sync with photostream.

    Welcome to the Apple community.
    Only photos taken on the iOS device and after photo stream was enabled will be added to photo stream.

  • Does anyone else how problems with numbers or pages spinning ball of death when saving

      Does anyone else have problems with Numbers or Pages when saving
    I have the spinning ball of death sitting there for a very long time..
    I am on a core i5 2.8ghz imac 27in with osx 10.7.5
    I have 12 gig of ram and it flies for eveything else but both numbers and pages have the problem when I go to quit..
    help please

    "We absolutely have to work off of a server so I can't get around that."
    Somebody has forced you to suffer the consequences.
    I've worked for companies like that and you have my condolences.

  • Error  " Selected numbers does not agree with transferred"

    Hi,
    While in production support I got a issue saying
    Error  " Selected numbers does not agree with transferred"
    How to solve this.
    Regards
    San Reddy

    Hi,
    This doesnt mean that its a failure.
    I will suggest you to check a few places where you can see the status
    1) SM37 job log (In source system if load is from R/3 or in BW if its a datamart load) (give request name) and it should give you the details about the request. If its active make sure that the job log is getting updated at frequent intervals.
    Also see if there is any 'sysfail' for any datapacket in SM37.
    2) SM66 get the job details (server name PID etc from SM37) and see in SM66 if the job is running or not. (In source system if load is from R/3 or in BW if its a datamart load). See if its accessing/updating some tables or is not doing anything at all.
    3) RSMO see what is available in details tab. It may be in update rules.
    4) ST22 check if any short dump has occured.(In source system if load is from R/3 or in BW if its a datamart load)
    5) SM58 and BD87 for pending tRFCs.
    Once you identify you can rectify the error.
    If all the records are in PSA you can pull it from the PSA to target. Else you may have to pull it again from source infoprovider.
    If its running and if you are able to see it active in SM66 you can wait for some time to let it finish. You can also try SM50 / SM51 to see what is happening in the system level like reading/inserting tables etc.
    If you feel its active and running you can verify by checking if the number of records has increased in the data tables.
    SM21 - Job log can also be helpful.
    In your case its probably because of tRFC issue.
    Check SM58 / BD87 for pending tRFCs.
    Thanks,
    JituK

  • Does 'versions' work with microsoft word, ppt and excel or just pages, keynote and numbers?

    Does 'versions' work with microsoft word, ppt and excel or just pages, keynote and numbers? I tried to do what the videos say but the little icon for versions is not there on word. Does this mean it only works for pages etc... or do i have to activate it somehow? If it is only for pages then this ***** and should be better advertised!!!

    Each application will need to be updated to work with Versions, Full Screen, and other Lion-specific features.

  • In numbers 2 there was a "show search" which gave a list of all occurences of a value with the location. Does this exist in Numbers 3?

    in numbers 2 there was a "show search" which gave a list of all occurrences of a value with the location. Does this exist in Numbers 3?

    G.,
    The search results pane is gone in V3. If it's critical, stay in V2. I'm not being flippant, I have certain documents that I very carefully keep away from V3 because I don't want to give up the V2 features for those particular files. Some users have reported problems with having both versions active at the same time, so it's best to quit one before launching the other, but other than that you just need to be careful not to open your V2 documents with V3.
    Jerry

  • Pop-up Menu with numbers and letters

    When using a pop up menu i only have numbers in there e.g. $50. What i want to have in there is 3hrs instead of $50 because that's what will be relevant but
    the formula sees 3hrs as $50 so the spreadsheet still works. If i add letters eg $50 = 3hrs I get the following error message
    It would be great if its could say 3hrs instead of $50  4hrs instead of $70  5 hrs instead of $80
    Hope that all makes sense and someone can help me
    Many thanks
    Danny Kirk

    Hi Danny,
    When you put a mixture of numbers and letters into a cell, Numbers treats it as a (text) string. The arithmetic operators ( +, - * and / ) work only with numbers, duration values, and Date & Time values. You are getting an error because a formula using the value placed in the cell by the pop-up menu expects a number, but you have given it a (text) string.
    You can supply the operator with the number 50, formatted as currency ( $50 ), or you can provide a duration ( 3h ). If you place the operator into a formula that can use the type of value you choose, you will not get the error message.
    There does not appear to be a linear relationship between the number of hours and the number of dollars. Unless you can specify a relations ship that can be expressed mathematically, you will need to use a lookup table to match the hour values in the pop-up's menu to the related dollar value to be returned.
    Here's a simple example. Note that "3h" (without the quotes) as used in SGIII's example above is a Duration value, "3hrs" (again without the quotes) will be interpreted by Numbers as a duration, and will be automatically reformatted to display as "3h". The dollar amount has been entered (and displayed) as a number. The Amount column on the Main table has been formatted as Currency, with the default two decimal places.
    The formula in each cell of Main::Column A is: =LOOKUP(B,Lookup :: A,Lookup :: B)
    (LOOKUP is the name of the function used. "Lookup" is the name of the table from which the information is retrieved.)
    Regards,
    Barry

Maybe you are looking for