On the Home ribbon I would like to add the =Round function in the editing section where the autosum appears. Is there a way to do this? I found where to customize the ribbon, but it doesn't allow me to add this specific function.
On the Home ribbon I would like to add the =Round function in the editing section where the autosum appears. Is there a way to do this? I found where to customize the ribbon, but it doesn't allow me to add this specific function.
How do you intend to use this =Round function?
Is it just on your copy of Excel or is your intention to have this as part of a workbook for any and all users?
I dont get it!![]()
HTH
Regards, Jeff
This is just for my personal copy of Excel. I was using the Autosum button before for quick access, but it was causing problems with my formulas. Chatted with a friend and discovered that I need to use =ROUND(x*y,2) instead of =SUM(x*y). This fixed my problem, but now it will take a few more keystrokes or clicks to enter in whereas before I was simply clicking the Autosum button. I hope that makes sense.
Lol, I couldn't think of a better name![]()
One option...
Put this macro in your VBE in a module and then attach it to the QAT or even to the ribbon
On the ribbon...![]()
Sub MyRound() ActiveCell.FormulaR1C1 = "=ROUND(RC[-2]*RC[-1],2)" End Sub
File >> Options >> Customize ribbon >> Create New Group (Place it on the Home tab or wherever)
Next >> Choose commands from >> Macros >> Select MyRound >> Click Add (Of course to the New Group you just created)
QAT...
Same as steps above, but instead of select Customize ribbon, select right below, Quick Access Toolbar.
Now this macro is at your finger tips with one click.
Note: This assumes the x and y are right next to each other.
Example:
A1 (x) B1 (y) and round will be in C1
H32 (x) I32 (y) and round will be in J32
Hope this makes sense!
Thanks for your reply! I think I can follow most of these steps, they make sense. However, I don't know how to put a macro into a VBE. Steps please?
More of what Jeff proposes
https://www.youtube.com/watch?v=dmdolFcS-fI
Alan עַם יִשְׂרָאֵל חַי
Change an Ugly Report with Power Query
Database Normalization
Complete Guide to Power Query
Man's Mind Stretched to New Dimensions Never Returns to Its Original Form
See if this helps...
http://www.rondebruin.nl/win/code.htm
Thanks Alan!
Followed all of the steps in the link you provided. Was able to create the macro and add the new button to my ribbon perfectly. Thank you for that!
Only problem is that it does not work as a formula now. Perhaps it will help if I explain exactly what I am trying to do.
I am creating customer invoices. So column F is price per unit, G is quantity, and H is total (F*G)
For F I enter my cost for the unit, and multiply by the percentage I want to mark it up. This becomes a problem when rounding is involved and causes H to be wrong sometimes. This is why I need the ROUND formula instead of regular Autosum.
Example:
F11: =SUM(20.35*1.15)=23.40
G11: 2
H11: =SUM(F11*G11)=46.81 Obviously this is incorrect as it should be 46.80
When I enter F11 as =ROUND(20.35*1.15,2) then everything tallies correctly.
The problem with this is it requires much more typing on my part instead of the quick autosum button that I was using before. This is why I am trying to add the Round function to the Ribbon
Can you put together a sample mock-up sheet with what you have and what you expect?
Attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.
Remember to desensitize the data.
Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
I am sorry it took me so long to get back here; it has been a hectic week.
I am going to attempt to attach a sample document with the formulas I am talking about.
The first line shows it when I use the AutoSum button.
I like the use of this button because it is quick and simple, however it is producing a rounding issue for my invoices.
The second line shows the same amount but calculated with the =Round function instead.
This produces the correct value, but requires several more keystrokes on my part, which will really slow me down when doing invoices.
I would like to be able to have a button identical to the AutoSum button in the Ribbon, but have it be the =Round formula instead of =Sum.
I need to ask...
In cell F4, you actually hard code 20.35 * 1.15 into the formula?? You keep saying "several more keystrokes", but if you are hard coding =Round(20.35*1.15,2) then that's a lot of keystrokes.
Sorry, but I'm still not understanding.
See if this helps. In H3:H5, you can get the =Round formula in that cell in three relatively easy ways.
1) Double click and cell (H3:H5)
2) Use a keyboards shortcut with any cell (H3:H5) >> Ctrl + Shift + F
3) Use the new tab on the ribbon and select the button >> MyRound
Last edited by jeffreybrown; 06-27-2018 at 06:44 PM.
I am unsure what you mean by hardcode.
In F3 I simply click on AutoSum in the top right corner of the Ribbon, then type 20.35*1.15, then press tab. This automatically calculates the formula and then tabs me over to G3.
In F4 I typed out the entire formula to get it to use the round function. This is what I am trying to shortcut. I need to use the round function in order to have the H column come out with the correct answer. Unless you know of a better way to achieve this.
Last edited by dontgetit; 06-27-2018 at 06:47 PM. Reason: fix typos
Please see my attachment. By hardcode, I mean you physically type in 20.35, the times sign, and then 1.15.
In the attachment in post number #11, why not type the 20.35 in cell F3, 1.15 in cell G3, and then double click H3 to get the formula results.
Because this is a customer invoice that I print off and hand to the person. They might have 10 parts that each cost me a different amount of money. I then take that part and mark it up, in this case 15%. This is why it is $20.35 (my cost) times 1.15 (which equals their cost with the 15% markup). Then column G is how many were used. In this case there were two of whatever part used in their repair, making the end total for that particular part $46.80. Just like your receipt would read if you bought 5 of the same item from a store.
I do not maintain a regular inventory list for most parts because there are thousands of parts that could be used on all of the different equipment we service. Therefore we order what is needed on a case by case basis. Since this is how we order there are occasional price fluctuations from our wholesalers that would make maintaining a set price sheet more time consuming than its worth.
To make bookkeeping easier, I like to leave our cost hidden in the formula so that I can quickly open my version of the document and see exactly how much we paid for said part, and how much we marked up, on any given invoice . Rather than having to dig though the file cabinet to find old purchasing receipts.
Does that make more sense?
Not entirely I'm afraid, in the sense this does not appear to be an Excel issues per se, it's more a procedural practice.Does that make more sense?
Anyway, I posted a notice in our help area to see if anybody else has a suggestion. Sorry...
Well thanks for trying anyways!
Maybe someone over there will have a way to help.
for what it's worth I believe you want to do this instead:
- open your workbook
- File(tab)>Options(list entry)>Advanced(list entry)
- scroll most of the way down to the "When calculating this workbook" section
- select your workbook
- check the box that says "Set precision as displayed"
- it'll whine at you, click ok, then ok again to close the options dialogue box
now you should be able to:
- click cell F4
- type: =20.35*1.15
- tab key
- 2
- tab key
- type =
- left-click F11
- type *
- left-click H11
- enter/tab key(your preference, enter should take you to the next row though)
Last edited by Gregor y; 06-27-2018 at 07:47 PM. Reason: *1.15 not *0.15
If it'd make you feel better using my answer because of my street cred, then you can go ahead and clickAdd Reputation below to improve it.
although once the option is turned on, you could just as easily use your original entry method where you click the auto-sum button since Excel will now calculate off the digits shown instead of the ones "behind the scenes". It's just that when you use the auto-sum button it wraps the arithmetics you want to do 20.35*1.15 inside a =SUM(...) function which really does nothing, and this looks weird to people when they read the contents of the cell =SUM(20.35*1.15) because it's kinda like asking what's the sum of five? Five, when you don't add it to anything it is still five you tricky fox, but usually when people use the =SUM(...) formula they give it more than one thing =SUM(20.35*1.15, 16.45*1.15, 5.05*1.15) so the question becomes what's the sum of five, two and three? Ten, on most hands.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks