ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA - If / And Statements (https://www.excelbanter.com/excel-programming/364217-vba-if-statements.html)

Becky[_3_]

VBA - If / And Statements
 
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!


Jason S.

VBA - If / And Statements
 
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)




"Becky" wrote:

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!




All times are GMT +1. The time now is 02:59 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com