+ Reply to Thread
Results 1 to 7 of 7

format cell formula

  1. #1
    Juco
    Guest

    format cell formula

    I am trying to get this to work...
    IF C8 = 1 or 2 or 3 or 4 then print 200 in cell M7
    IF C8 = 5 or 6 then print 250 in cell M7

    I have tried various ways (hopeless at formulas) but can`t get it to work
    for me.
    help appreciated
    thanks



  2. #2
    IanRoy
    Guest

    RE: format cell formula

    Hi, Juco;
    I didn't see anything in your actual question to do with formatting, but
    here is one answer to the question: use the IF function with the OR function
    for its first argument, 200 for its second, and another IF function for its
    third. Use another OR function for the first argument in the second IF
    function, 250 for the second, and "" for the third ("" returns blank). So:
    =IF(OR(C8=1,C8=2,C8=3,C8=4),200,IF(OR(C8=5,C8=6),250,""))
    Regards,
    Ian.


    "Juco" wrote:

    > I am trying to get this to work...
    > IF C8 = 1 or 2 or 3 or 4 then print 200 in cell M7
    > IF C8 = 5 or 6 then print 250 in cell M7


  3. #3
    Forum Contributor
    Join Date
    08-23-2004
    Posts
    210
    There is probably another, better way, but try this method: In E1 to E6 type 1, 2, 3, 4, 5 and 6. In F1 to F6 type 200, 200, 200, 200, 250 and 250. In M7 type this formula: =VLOOKUP(C8,E1:F6,2). In C8 type a number from 1 to 6, and either 200 or 250 will appear in M7. The ranges E1 to E6 and F1 to F6 can be put anywhere out of the way, only the cell references will need changing to reflect their new position. Also, it is easier to make changes to the 200 and 250, etc. than having to alter a formula. Try out the above on a spare sheet.

  4. #4
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451
    Another option:

    In M7 type =CHOOSE(C8,200,200,200,200,250,250)

    Assuming M7 will always have a simple value of 1,2,3,4,5 or 6

  5. #5
    Ragdyer
    Guest

    Re: format cell formula

    Another way:
    Enter in M7:

    =(OR(C8={1,2,3,4})*200+(OR(C8={5,6}))*250)
    --
    HTH,

    RD

    ---------------------------------------------------------------------------
    Please keep all correspondence within the NewsGroup, so all may benefit !
    ---------------------------------------------------------------------------

    "Juco" <[email protected]> wrote in message
    news:[email protected]...
    > I am trying to get this to work...
    > IF C8 = 1 or 2 or 3 or 4 then print 200 in cell M7
    > IF C8 = 5 or 6 then print 250 in cell M7
    >
    > I have tried various ways (hopeless at formulas) but can`t get it to work
    > for me.
    > help appreciated
    > thanks
    >
    >



  6. #6
    Juco
    Guest

    Re: format cell formula

    Thanks for the help,
    it works a treat.

    thank you both
    Juco


    "Ragdyer" <[email protected]> wrote in message
    news:%[email protected]...
    > Another way:
    > Enter in M7:
    >
    > =(OR(C8={1,2,3,4})*200+(OR(C8={5,6}))*250)
    > --
    > HTH,
    >
    > RD
    >
    > --------------------------------------------------------------------------

    -
    > Please keep all correspondence within the NewsGroup, so all may benefit !
    > --------------------------------------------------------------------------

    -
    >
    > "Juco" <[email protected]> wrote in message
    > news:[email protected]...
    > > I am trying to get this to work...
    > > IF C8 = 1 or 2 or 3 or 4 then print 200 in cell M7
    > > IF C8 = 5 or 6 then print 250 in cell M7
    > >
    > > I have tried various ways (hopeless at formulas) but can`t get it to

    work
    > > for me.
    > > help appreciated
    > > thanks
    > >
    > >

    >




  7. #7
    Ragdyer
    Guest

    Re: format cell formula

    Appreciate the feed-back.
    --
    Regards,

    RD

    ---------------------------------------------------------------------------
    Please keep all correspondence within the NewsGroup, so all may benefit !
    ---------------------------------------------------------------------------
    "Juco" <[email protected]> wrote in message
    news:[email protected]...
    > Thanks for the help,
    > it works a treat.
    >
    > thank you both
    > Juco
    >
    >
    > "Ragdyer" <[email protected]> wrote in message
    > news:%[email protected]...
    > > Another way:
    > > Enter in M7:
    > >
    > > =(OR(C8={1,2,3,4})*200+(OR(C8={5,6}))*250)
    > > --
    > > HTH,
    > >
    > > RD
    > >

    >
    > --------------------------------------------------------------------------
    > -
    > > Please keep all correspondence within the NewsGroup, so all may benefit

    !
    >
    > --------------------------------------------------------------------------
    > -
    > >
    > > "Juco" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > I am trying to get this to work...
    > > > IF C8 = 1 or 2 or 3 or 4 then print 200 in cell M7
    > > > IF C8 = 5 or 6 then print 250 in cell M7
    > > >
    > > > I have tried various ways (hopeless at formulas) but can`t get it to

    > work
    > > > for me.
    > > > help appreciated
    > > > 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.6.0 RC 1