• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Nutrition assessment for Cancer patients

jhau1234

New Member
Dear Sir,
I am engaged in a cancer management setup and am preparing an excel for calculating nutrition requirements for our patients. I have the excel sheet and am struck at calculating the water requirement. The theory for the calculation of water requirement is "4 mL / kg / hour for the first 10kg of body weight, 2 mL / kg / hour for the second 10kg of body weight (11kg - 20kg), 1 mL / kg / hour for any kilogram of body mass above 20kg (> 20kg)" . Please help me to write the code. When I enter the weight and click the "Calculate" button, it should give the result. Kindly help.
 

Attachments

  • BMI BSA.xlsm
    23 KB · Views: 4
Note that a Dim declaration must specify a data type for every variable. This declaration
Code:
Dim weight, height, x As Single
makes x a Single but the other variables are not given a type so will default to Variant.

I have posted a file with the solution to your question and the correction above.

Why are you using VBA for this? This could all be done simply with formulas on the worksheet.
 

Attachments

  • jhau1234=chandoo=BMI BSA.xlsm
    27.4 KB · Views: 2
A formula will give you that:
Code:
=MIN(B4,10)*4+MAX(0,MIN(B4,20)-10)*2+MAX(0,B4-20)
 
Note that a Dim declaration must specify a data type for every variable. This declaration
Code:
Dim weight, height, x As Single
makes x a Single but the other variables are not given a type so will default to Variant.

I have posted a file with the solution to your question and the correction above.

Why are you using VBA for this? This could all be done simply with formulas on the worksheet.

Dear Sir,
Once I have the format ready will be stored in the multiple systems in the different wards. Since the formulas may get deleted accidentally, I am opting for VBA for stability. Also we have a plan to store the data to analyse the patient's progress. For that, we are trying u to use VBA for making it future-ready.

Regarding the water calculation, for a patient with a weight of 40 kg
1. first 10 kgs X 4 ml = 40 ml
2. second 10 kgs X 2 ml = 20 ml
3 remaining 20 kgs X 1 ml = 20 ml
Total water to be given per hour is (40+20+20) ml = 80 ml
The answer the code is getting is = 26 ml

Kindly see and help.
 
Dear Sir,
In the attached excel sheet on the Tube feed page, cell B5 to get the ideal body weight from the list in the "IdealBodyWeight" sheet depending on the gender seclted (in the cell "E2") and the height (noted in "B3"). In the reference list, the height is in "inches" and our input is in "cm". Kindly help to integrate this, please.
 

Attachments

  • BMI BSA.xlsm
    24.4 KB · Views: 1
Back
Top