+ Reply to Thread
Results 1 to 2 of 2

Thread: VBA - If / And Statements

  1. #1
    Becky
    Guest

    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!


  2. #2
    Jason S.
    Guest

    RE: 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!
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.2.0