VBA - If / And Statements

B

Becky

I am very green to vba so I am not sure how to do this...but since all

I can figure is avery complicated nested IF statements, I thought maybe

VBA is where is belongs.

We have a spreadsheet where depending on what size is put in column C
and Column D, we want it to group 1 way in column e and another way in
column f (mosty rounding two different ways)


example
C D E F
<5 Outpatient 6 12
12.2 Inpatient 14 18
23.7 Inpatient 24 26
16.5 Inpatient 17 18


Can anyone help with this or give me a better suggestions to do this?
Many thanks!
 
G

Guest

A benefit to backing this worksheet with VBA is delete button casualties.
Yet conditional statements can be used in cell formulas. Make sure you copy
the formula, in the event of a mishap. IF/IIF statements are not complicated.
They are simple decisions. IF (based on this criteria) THEN (do these things)
ELSE (do these things) END IF;;;Likewise =IIF(criteria,do these,else do these)

You can pair criteria using boolean operators :
AND - conjoing criteria
OR - either criteria

E1: IIF((C=?) AND (D=?), round(C), round(C)+1)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top