+ Reply to Thread
Results 1 to 10 of 10

Excel 2007 : Conditional Formatting: Replace Text

  1. #1
    Registered User
    Join Date
    04-15-2010
    Location
    Sweden
    MS-Off Ver
    Excel 2007
    Posts
    11

    Conditional Formatting: Replace Text

    Hi Guys,

    Did a search on Conditional Formatting, but could not find anything to solve my issse, hence this post. Please Help

    I have a worksheet with alot of different numbers in it, the numbers are sourced via a forumla as per below,
    =(('Sheet1'!A1-'Sheet1'!A2)/'Sheet1'!A2)*123+100

    This formula generally yields a value ranging between 50 and 150.
    I have then setup conditional formatting on the cell to fill in either red, yellow, green based on a value between 50 and 150.
    ie. If less than 100 = Red
    If less than 110 > 100 = Yellow
    If > 110 = Green

    What i would like it to also do is, if the value is less than 50, replace it with 50, and if more than 150 replace with 150.
    Is this possible ?

    Thanks for the help!

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Conditional Formatting: Replace Text

    I'm thinking you can use a double if statement to do this.

    Say your formula is BELOW
    =(('Sheet1'!A1-'Sheet1'!A2)/'Sheet1'!A2)*123+100
    Then you could do an if statement like
    Please Login or Register  to view this content.
    Replace the above on all your current formulas and it should do the trick.

    hope that helps
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Conditional Formatting: Replace Text

    You could use:
    =MEDIAN(SLN(Sheet1!A1,Sheet1!A2,Sheet1!A2)*123+100,50,150)
    Remember what the dormouse said
    Feed your head

  4. #4
    Registered User
    Join Date
    04-15-2010
    Location
    Sweden
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Conditional Formatting: Replace Text

    Quote Originally Posted by romperstomper View Post
    You could use:
    =MEDIAN(SLN(Sheet1!A1,Sheet1!A2,Sheet1!A2)*123+100,50,150)
    Brilliant, Thanks Works like a charm!

  5. #5
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Conditional Formatting: Replace Text

    Hi,

    I just figured out the =Median(A1,50,150) and realized why it returns 50, A1 or 150 because one of them must be in the middle. That was a breakthrough for me.

    Now what was the SLN in this answer? Why was it part of the answer?

  6. #6
    Registered User
    Join Date
    04-15-2010
    Location
    Sweden
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Conditional Formatting: Replace Text

    Same here Marvin, learnt something new about the Median and how it works.

    Regarding the SLN, SLN is a depreciation formula (straight line)

    SLN has 3 variable, Cost, Residual Value & Periods.
    E.g. Cost= 20,000 Residual Value= 5,000 Periods=5

    formula would be =SLN(Cost, Residual Value, Periods) = SLN(20000, 5000, 5)
    Result = 3,000

    In Effect a pretty basic formula, ie. (20000 - 5000)/5

    For my use i did not use it for depreciation, but to do performance to target calculation.
    ie. Target= 10 Actual= 8

    Therefore, =SLN(8, 10, 10) (repeat the reference for Residual and Periods)

    Hope that post made sense

  7. #7
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Conditional Formatting: Replace Text

    I guess my question is -
    Why did Romper use the SLN at all?
    He suggested
    Please Login or Register  to view this content.
    But why wouldn't
    Please Login or Register  to view this content.
    work?

  8. #8
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Conditional Formatting: Replace Text

    What do you think this:
    (Sheet1!A1,Sheet1!A2,Sheet1!A2)
    would do?

  9. #9
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Conditional Formatting: Replace Text

    I copied the wrong line from above. I wanted to copy the first formula of:
    =(('Sheet1'!A1-'Sheet1'!A2)/'Sheet1'!A2)*123+100
    So, are you suggesting the above is the same as:
    =SLN((Sheet1!A1,Sheet1!A2,Sheet1!A2) ?

  10. #10
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Conditional Formatting: Replace Text

    No, I'm suggesting it's the same as:
    =SLN(Sheet1!A1,Sheet1!A2,Sheet1!A2)*123+100

    There's no good reason to use SLN instead but it does the same.

+ 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