If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
question driving me nuts
Okay...I never thought I would ever have to use excel again. Lo and behold, I
am now the owner of a business and have forgotten how to do some things. I know how to create formaulas for adding and stuff. I forgot how to make my calculatons so that my deposit would be broken down. For example say I have 5 of each dollar denomination (1,2,5,10,20,50,100) and coin (1,5,10,25,50,$1). My deposit has to be 790 (5 of each denomination-150). What I want my sheet to do is tell me how much of each denomination I should pull out in terms of numbers instead of dollar amount. For exaple instead of telling me to pull $790 I want it to tell me to pull 5-$100 bills 5-$50 bills and 4-10 bills. Basically breaking down my cash with the largest possible denomination until there can be no more. Any help would be deeply appreciated. |
#2
|
|||
|
|||
question driving me nuts
Please do not duplicate posting in multiple groups. If
you "must", do so only if your news reader allows you to crosspost. (I do not see any way to do that with Microsoft "community newsgroups".) See responses in the Microsoft group Excel General Questions, aka the newsgroup microsoft.public.excel.misc. |
#3
|
|||
|
|||
question driving me nuts
Try code like the following:
Dim Amount As Integer Dim Num100 As Integer Dim Num50 As Integer Dim Num20 As Integer Dim Num10 As Integer Dim Num5 As Integer Dim Num1 As Integer Amount = 790 ' CHANGE Num100 = Amount \ 100 Amount = Amount - (100 * Num100) Num50 = Amount \ 50 Amount = Amount - (50 * Num50) Num20 = Amount \ 20 Amount = Amount - (20 * Num20) Num10 = Amount \ 10 Amount = Amount - (10 * Num10) Num5 = Amount \ 5 Amount = Amount - (5 * Num5) Num1 = Amount Debug.Print Num100, Num50, Num20, Num10, Num5, Num1 -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Esaam" wrote in message ... Okay...I never thought I would ever have to use excel again. Lo and behold, I am now the owner of a business and have forgotten how to do some things. I know how to create formaulas for adding and stuff. I forgot how to make my calculatons so that my deposit would be broken down. For example say I have 5 of each dollar denomination (1,2,5,10,20,50,100) and coin (1,5,10,25,50,$1). My deposit has to be 790 (5 of each denomination-150). What I want my sheet to do is tell me how much of each denomination I should pull out in terms of numbers instead of dollar amount. For exaple instead of telling me to pull $790 I want it to tell me to pull 5-$100 bills 5-$50 bills and 4-10 bills. Basically breaking down my cash with the largest possible denomination until there can be no more. Any help would be deeply appreciated. |
#4
|
|||
|
|||
question driving me nuts
i was trying it out, do ihave to precede eac statement with an equal sign. i
would appreciate it if you could tell me how to enter this. i.e, in one cell, across multiple cells "Chip Pearson" wrote: Try code like the following: Dim Amount As Integer Dim Num100 As Integer Dim Num50 As Integer Dim Num20 As Integer Dim Num10 As Integer Dim Num5 As Integer Dim Num1 As Integer Amount = 790 ' CHANGE Num100 = Amount \ 100 Amount = Amount - (100 * Num100) Num50 = Amount \ 50 Amount = Amount - (50 * Num50) Num20 = Amount \ 20 Amount = Amount - (20 * Num20) Num10 = Amount \ 10 Amount = Amount - (10 * Num10) Num5 = Amount \ 5 Amount = Amount - (5 * Num5) Num1 = Amount Debug.Print Num100, Num50, Num20, Num10, Num5, Num1 -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Esaam" wrote in message ... Okay...I never thought I would ever have to use excel again. Lo and behold, I am now the owner of a business and have forgotten how to do some things. I know how to create formaulas for adding and stuff. I forgot how to make my calculatons so that my deposit would be broken down. For example say I have 5 of each dollar denomination (1,2,5,10,20,50,100) and coin (1,5,10,25,50,$1). My deposit has to be 790 (5 of each denomination-150). What I want my sheet to do is tell me how much of each denomination I should pull out in terms of numbers instead of dollar amount. For exaple instead of telling me to pull $790 I want it to tell me to pull 5-$100 bills 5-$50 bills and 4-10 bills. Basically breaking down my cash with the largest possible denomination until there can be no more. Any help would be deeply appreciated. |
#5
|
|||
|
|||
question driving me nuts
That is VB code that needs to be entered into the VB Editor within Excel
ToolsMacrosVisual Basic Editor Chip has just given you the basis of what you need for you to tweak etc. (I think). Entering this into cells will not help. What you are trying to do would require code as far as I can tell rather than formulas entered into the cells.. Esaam wrote: i was trying it out, do ihave to precede eac statement with an equal sign. i would appreciate it if you could tell me how to enter this. i.e, in one cell, across multiple cells "Chip Pearson" wrote: Try code like the following: Dim Amount As Integer Dim Num100 As Integer Dim Num50 As Integer Dim Num20 As Integer Dim Num10 As Integer Dim Num5 As Integer Dim Num1 As Integer Amount = 790 ' CHANGE Num100 = Amount \ 100 Amount = Amount - (100 * Num100) Num50 = Amount \ 50 Amount = Amount - (50 * Num50) Num20 = Amount \ 20 Amount = Amount - (20 * Num20) Num10 = Amount \ 10 Amount = Amount - (10 * Num10) Num5 = Amount \ 5 Amount = Amount - (5 * Num5) Num1 = Amount Debug.Print Num100, Num50, Num20, Num10, Num5, Num1 -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Esaam" wrote in message ... Okay...I never thought I would ever have to use excel again. Lo and behold, I am now the owner of a business and have forgotten how to do some things. I know how to create formaulas for adding and stuff. I forgot how to make my calculatons so that my deposit would be broken down. For example say I have 5 of each dollar denomination (1,2,5,10,20,50,100) and coin (1,5,10,25,50,$1). My deposit has to be 790 (5 of each denomination-150). What I want my sheet to do is tell me how much of each denomination I should pull out in terms of numbers instead of dollar amount. For exaple instead of telling me to pull $790 I want it to tell me to pull 5-$100 bills 5-$50 bills and 4-10 bills. Basically breaking down my cash with the largest possible denomination until there can be no more. Any help would be deeply appreciated. |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Question about reducing number of tables in a database | tlyczko | Database Design | 0 | October 27th, 2005 04:15 PM |
How do I find and replace a question mark in Excel? | Ranpalandil | General Discussion | 1 | September 7th, 2005 10:20 PM |
Search my question lost in the long list | Shrikant | General Discussion | 3 | August 26th, 2005 09:32 AM |
How to gray-out a question dialog box | S_Kaplan | General Discussion | 3 | October 26th, 2004 12:11 AM |
Designing a question paper | Ken | New Users | 2 | April 28th, 2004 10:13 PM |