LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 210
Default Writing a simple macro or formula

Your formula is close - I have figured it out with pencil and paper and it
is very close but I am just trying to figure out a volume not a rate - so the
only value I have to input is the 15 pounds. From that all of the numbers
should fall out. So on paper it looks like this.

This is the problem:

1. Convert child's wt in lbs to kg
2. Calculate 100 ml of fluid/kg/24 hr for the 1st 10 kg of wt
3. Calculate 50 ml of fluid/kg/24 hr for the 2nd 10 kg of wt
4. Calculate 10 to 25 ml of fluid/kg/24 hr for each kg over 20 of wt
5. Add the products of steps 2,3, and 4 to determine the ml of fluid
needed/24 hrs

This is the solution on paper:

Maintenance Fluids
15lb €“ 28.4ml/hr for a total of 681.6ml/24 hours
40lb €“ 58.6ml/hr for a total of 1,406.4ml/24 hours
70lb €“ 72.3ml/hr for a total of 1,735.2ml/24 hours

So again the only input is the weight in pounds.

You are so kind to help me and I hope this will not offend you. Thanks for
taking another look at it. I am using your suggestions and trying to build it
from there but I think it is hard to understand without a medical background.
If the child ends up not weighing over 10kg then the amount of fluid is just
100ml/kg, but if the child weighs more than 20kg then I have to figure 100ml
for the 10kg + 50ml for the next 10kg + 20ml for each additional kg.

I think we are so on the right track - just a little refining. I used to
write stuff in Excel all the time but that was a long time ago and I just
don't remember it anymore. Again THANKS SO MUCH for looking at this.

"MC" wrote:

Oops! Make sure to change all the B3 references in the IF...THEN statements
to reference B4.

MC

"M C Del Papa" wrote in message
et...
Robin,

You definitely don't need a macro to do this. A simple formula using some
IF...THEN statements will do fine. Below is one approach (note I skipped
some rows and columns so you can add headings, etc.):

Enter wt in cell B3
Convert to kg in B4: =B3*0.453593

Enter desired fluid rate for 1st 10 kg in B7
Calculate fluid rate in C7: =IF(B3=10,10*B7,B3*B7)
Enter desired fluid rate for 2nd 10 kg in B8
Calculate fluid rate in C8: =IF(B3=20,10*B8,IF(B3=10,(B3-10)*B8,0))
Enter desired fluid rate for 20 kg in B9
Calculate fluid rate in C9: =IF(B3=20,(B3-20)*B9,0)

Sum in cell C10 to get the total fluid rate: =SUM(C7:C9)

MC

"Robin" wrote in message
...
Hi I don't know how to do this but I know it can be done. I want to
write a
simple macro (or maybe just a formula) - it doesn't have to look that
pretty
as I am the only one using it. It is the following:

STEPS TO CALCULATE USUAL MAINTENANCE FLUIDS:
1. Convert child's wt in lbs to kg
2. Calculate 100 ml of fluid/kg/24 hr for the 1st 10 kg of wt
3. Calculate 50 ml of fluid/kg/24 hr for the 2nd 10 kg of wt
4. Calculate 10 to 25 ml of fluid/kg/24 hr for each kg over 20 of wt
5. Add the products of steps 2,3, and 4 to determine the ml of fluid
needed/24 hrs


So I want to be able to plug in a weight in pounds, and this "macro" give
me
the individual answers for each step, then the total at the end. And yes
I
can do it on paper all day long I just want to be able to do it quicker
and
check myself.

Thanks
Robin






 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
IF formula-simple question; simple operator Rich D Excel Discussion (Misc queries) 4 December 6th 07 03:36 PM
Simple problem, simple formula, no FUNCTION ! Ron@Buy Excel Worksheet Functions 6 September 28th 07 04:51 PM
Writing a macro Sylvia[_6_] Excel Programming 1 January 10th 06 01:40 PM
VB Macro writing a formula to a cell Neal Zimm Excel Programming 2 September 15th 05 08:09 PM
help in writing a macro slim[_2_] Excel Programming 1 February 13th 04 01:41 AM


All times are GMT +1. The time now is 11:13 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"