+ Reply to Thread
Results 1 to 5 of 5

An IF formatting problem?

Hybrid View

  1. #1
    Registered User
    Join Date
    03-05-2008
    Posts
    3

    An IF formatting problem?

    Hiyas folks:
    I am working on what I thought would be a simple sheet to calculate the amount of time needed to shut off my line for a product change. The Problem is I haven't figured out how to put in the cell to show the number I want via another number. I want 0 to equal 126, 1 to equal 124, 2 to equal 122 etc.
    Thanks for any help in advance.
    Mark

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Maybe

    =IF(A1="","",LOOKUP(A1,{0,1,2,3,4,5,6},{126,124,122,120,118,116}))
    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    03-05-2008
    Posts
    3

    IF formatting problem?

    I'll Give that a shot thanks.

  4. #4
    Forum Contributor
    Join Date
    10-27-2006
    Location
    United Kingdom
    MS-Off Ver
    EXCEL 2003 (2007 at home)
    Posts
    517
    If your initial numbers are simple integer values between 0 and 6 then you could use:
    =CHOOSE(A1+1,126,124,12 2,120,118,116)

    rather than the lookup array function.

    Mark.

  5. #5
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582
    Or, you could use a simple linear formula (y=mx+b) where m = -2, b=126
    Assuming your x (0 to 6) is in cell A1
    =A1*-2+126
    ChemistB

+ 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