+ Reply to Thread
Results 1 to 15 of 15

Something about excel that has not been asked, I think

  1. #1
    Forum Contributor
    Join Date
    11-10-2011
    Location
    Bucharest, RO
    MS-Off Ver
    Excel 2016
    Posts
    118

    Something about excel that has not been asked, I think

    How can I format an Excel worksheet so that when I type in a cell, eg 10K, excel software to interpret it as 10000 (but I want show me 10K)? Is there any way to do this without calling VBA? Please.

  2. #2
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Something about excel that has not been asked, I think

    Custom format and type in #,K
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  3. #3
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,947

    Re: Something about excel that has not been asked, I think

    You cannot do this without using either a helper column of formulas or VBA - Excel will never interpret 10K as 10000 unless you replace the 10K with the number 10000. You can do this automatically by using event code - copy the code, right-click the sheet tab, select "View Code" and paste the code into the window that appears. Then save the workbook as a macro-enabled .xlsm.

    Please Login or Register  to view this content.
    When you enter 10K into a cell, it will appear as 10K but actually be 10000, so calculations will work using that cell's value.
    Last edited by Bernie Deitrick; 03-24-2014 at 01:07 PM.
    Bernie Deitrick
    Excel MVP 2000-2010

  4. #4
    Forum Contributor
    Join Date
    11-10-2011
    Location
    Bucharest, RO
    MS-Off Ver
    Excel 2016
    Posts
    118

    Re: Something about excel that has not been asked, I think

    Yeah, thanks, @AlKey, it seems to work.
    But I have further questions, namely: how to display instead of K ---->
    I can use the "Custom Format menu" various symbols?

    @Bernie, thanks for the reply, I immediately analyze and your solution.

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: Something about excel that has not been asked, I think

    You can add pretty much any text in custom, the way AlKey showed you, so just use KΩ instead of just K
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  6. #6
    Forum Contributor
    Join Date
    11-10-2011
    Location
    Bucharest, RO
    MS-Off Ver
    Excel 2016
    Posts
    118

    Re: Something about excel that has not been asked, I think

    OK, I understand @FDibbins.

    Now, I tried @Bernie VBA's example and I have a question: if in an excel worksheet there are several formatting - eg K, uF, nF, pF - how should I change the VBA code exemplified by you, so that when I'm typing 100nF, excel interpret this thing as if as 100 x 10^-9, then, when I type 10KΩ --- > 10000 ..... ?
    I think VBA is much more appropriate solution because avoiding the start formatting each cell in a certain way.

  7. #7
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,947

    Re: Something about excel that has not been asked, I think

    You need to use the custom Format #,K and then hold down the alt key and type 234 on the number keypad (to get the Omega to show as Ω.

    If you want to use code, it is not as easy to get the format string to work - apply that formatting to a cell, name the cell FCell, and use this code

    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    11-10-2011
    Location
    Bucharest, RO
    MS-Off Ver
    Excel 2016
    Posts
    118

    Re: Something about excel that has not been asked, I think

    @Bernie, your example works fine but it is not 100% correct. If I'm typing in a cell excel 20K and excel cell displays 20000. I want to show my whole 20K in the cells but in the fx (function) line displaying 20000. How I do this? And how to broaden the above code and with other abbreviations, like nF, uF...?

  9. #9
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,947

    Re: Something about excel that has not been asked, I think

    I don't think there is any way to show 0.0000000X as just X without using a helper cell for actual number storage.

  10. #10
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,947

    Re: Something about excel that has not been asked, I think

    My code enters 20000 into the cell, which will show as 20000 in the formula bar, but as 20K on the sheet, so I'm not sure what you mean. But the other abbreviations are not possible, AFAIK, since they are below 1.

  11. #11
    Forum Contributor
    Join Date
    11-10-2011
    Location
    Bucharest, RO
    MS-Off Ver
    Excel 2016
    Posts
    118

    Re: Something about excel that has not been asked, I think

    So, I can implement in VBA only one abbreviation (or custom format)? I understood well?

  12. #12
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,947

    Re: Something about excel that has not been asked, I think

    You can implement as many as you want, as long as they are for numbers > 1000 - millions, billions, trillions. But the decimal presents problems.

  13. #13
    Forum Contributor
    Join Date
    11-10-2011
    Location
    Bucharest, RO
    MS-Off Ver
    Excel 2016
    Posts
    118

    Re: Something about excel that has not been asked, I think

    I would like to implement for:
    1) GHz = 1000000; kHz = 1000;
    2) uF = 1/1000000; nF = 1/1000000000; pF = 1/1000000000000.
    3) MΩ = 1000000; kΩ = 1000.
    Can you show an example of VBA for all the examples above? Please.

  14. #14
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,947

    Re: Something about excel that has not been asked, I think

    No, I cannot - Excel does not have a shorthand way to show 1/1000000 as 1uF; 1/1000000000 as 1nF; or 1/1000000000000 as 1 pF.

  15. #15
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: Something about excel that has not been asked, I think

    I don't know that Excel has a good, preprogrammed way to deal with units plus metric prefixes.

    What exactly are you needing here? Excel can be programmed to handle units like this, but you may need to think through a little more exactly what you want it to do.

    From the examples given, it looks like you simply need a utility that will "move the decimal" for you depending on the metric prefix for a given entry. Do you need it to do more than that? My first thought for something that just needs to change prefix is to drop the base unit from the input, then use the prefix with "m" (meter) in the CONVERT() function. http://office.microsoft.com/en-us/ma...551.aspx?CTT=1

    I almost always find this sort of thing easier to program if I keep the value and unit in separate cells, so each cell contains only one piece of information.

    Illustrated in attached spreadsheet.

    There are certainly other strategies I use when performing different unit conversions. A lot depends on exactly what I need to do with the numbers after I enter them.
    Attached Files Attached Files
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

+ 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] Excel is plotting additional series not asked by the VBA code.
    By kyleg222 in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 07-10-2012, 11:04 AM
  2. Asked previously...can this not be done in excel
    By simonsmith in forum Excel General
    Replies: 1
    Last Post: 05-16-2006, 06:38 PM
  3. I bet this has been asked before
    By Wibs in forum Excel General
    Replies: 2
    Last Post: 01-18-2006, 04:40 PM
  4. [SOLVED] I'm sure this has been asked before....
    By David in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-29-2005, 02:05 PM
  5. [SOLVED] Desperate I know I asked before
    By jenkinspat in forum Excel General
    Replies: 1
    Last Post: 03-03-2005, 06:06 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