Excel Macro experts out there?

Closed
dpratt Posts 1 Registration date Saturday March 14, 2015 Status Member Last seen March 14, 2015 - Mar 14, 2015 at 11:40 AM
MaxStart Posts 340 Registration date Tuesday March 3, 2015 Status Moderator Last seen July 3, 2015 - Mar 15, 2015 at 04:10 PM
Hello all,
I am very new to writing macros and was looking for some guidance in writing one for patient blood volume.

What I am looking to do is given a patient weight for example (70 kg with normal build) it will give me the blood volume factor of 65 ml/kg. The intervals are:

Weight Blood volume
0-10 85
10-25 80
25-45 70
>45 normal 65
>45 thin 70

Any help you could give me would be greatly appreciated. I've searched several other forums and can't find a thread that has a similar problem

2 replies

how do you distinguish between 45 normal and 45 thin?
1
Hello RayH! Thanks for your reply. I am not sure if that can be worked into the macro. If not I Can omit ">45 thin 70"

This is what I have so far:
Sub Patient_workup()
Dim Value As Integer

Value = Cells(5, 3)

If Value > 45 Then
Cells(28, 3) = 65


End If
End Sub

I do not know how to add the other conditions? Your thoughts?
0
MaxStart Posts 340 Registration date Tuesday March 3, 2015 Status Moderator Last seen July 3, 2015 69 > dpratt
Mar 15, 2015 at 04:10 PM
did you download the file in the reply below?
it meets all your conditions without the need for macros
I can do a macro but you don't really need it it's just a simple formula
0
MaxStart Posts 340 Registration date Tuesday March 3, 2015 Status Moderator Last seen July 3, 2015 69
Mar 15, 2015 at 03:38 PM
I've created this for you
https://drive.google.com/file/d/0B9oAs-iFHasdMVQ1NElwT3lHeTQ/view?usp=drive_open

this is the basic formula you don't need macros
=IF(A2<=10,85,IF(A2<=25,80,IF(A2<=45,70,IF(AND(A2>45,C2="normal"),65,IF(AND(A2>45,C2="Thin"),70)))))
0