+ Reply to Thread
Results 1 to 21 of 21

Conditional Formating and Formula Help

  1. #1
    Registered User
    Join Date
    09-17-2013
    Location
    Edmonton
    MS-Off Ver
    Excel 2007
    Posts
    47

    Conditional Formating and Formula Help

    Hey Everyone,

    I'm dealing with conditional formating. I've set it up so that specific cells will have their fill colors change depending on information on a particular cell. I have roughly 125 rows where I need to change the conditional formating formula.

    For Exmaple
    Row #1 =OR($F$4="MT/G7", $F$4="NCA", $F$4="AHS", $F$4="H2", $F$4="Shuttle")
    Row #2 =OR($F$6="MT/G7", $F$6="NCA", $F$6="AHS", $F$6="H2", $F$6="Shuttle")

    The process of changing each cell with conditional formating is very tedious... I can't copy or drag down the conditional formating, errors occur.

    So questions:
    - Is there a way to reduce the above forumla so that I only have to change on cell. For example, something along the lines of =Or($F$4="Mt/G7", "NCA", "AHS") <- this doesnt work, but I just want to have to change one number... so from $F$4 to $F$6.. etc. Rather than doing it for every ""
    -Ideally I'd like to set up the correct conditional formating and then copy or drag it down with Excel figuring out which cells it needs to apply too and chance the formula by 2 every time. But I havent been able to do so.

    Any help would be greatly appreciate, thanks!

  2. #2
    Registered User
    Join Date
    09-17-2013
    Location
    Edmonton
    MS-Off Ver
    Excel 2007
    Posts
    47

    Re: Conditional Formating and Formula Help

    excel.jpg




    I'd imagine a visual will help.... See attachement So the conditional formatting is on W4 & Y4 and will alter fill color based on F4. For each formula, the column will always be the same, but the row must change by 2.
    Last edited by Eaks77; 09-17-2013 at 04:40 PM.

  3. #3
    Registered User
    Join Date
    09-17-2013
    Location
    Edmonton
    MS-Off Ver
    Excel 2007
    Posts
    47

    Re: Conditional Formating and Formula Help

    Bump bump bump

  4. #4
    Registered User
    Join Date
    09-17-2013
    Location
    Edmonton
    MS-Off Ver
    Excel 2007
    Posts
    47

    Re: Conditional Formating and Formula Help

    Bump Bumped Bump

    No Suggestions?

  5. #5
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Conditional Formating and Formula Help

    I can't interpret anything from your screencap.

    If you can post a SMALL sample file that'll give us a better idea of what you're wanting to do.

    SMALL = no more than 20 rows worth of data.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: Conditional Formating and Formula Help

    I agree with Biff. have you looked at the pic you uploaded?

    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  7. #7
    Registered User
    Join Date
    09-17-2013
    Location
    Edmonton
    MS-Off Ver
    Excel 2007
    Posts
    47

    Re: Conditional Formating and Formula Help

    Hey,

    Thanks for the heads up. I've clicked the attachement and it appears fine :s It opens up on a new page. I'll see if i can do anything different :S

  8. #8
    Registered User
    Join Date
    09-17-2013
    Location
    Edmonton
    MS-Off Ver
    Excel 2007
    Posts
    47

    Re: Conditional Formating and Formula Help

    Hey,

    Thanks for the heads up. I've clicked the attachement and it appears fine :s It opens up on a new page. I'll see if i can do anything different :S

  9. #9
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: Conditional Formating and Formula Help

    upload the sample file please

  10. #10
    Registered User
    Join Date
    09-17-2013
    Location
    Edmonton
    MS-Off Ver
    Excel 2007
    Posts
    47

    Re: Conditional Formating and Formula Help

    alrighty, will do. I'm attaching it to this message. I've simplified the Sample which makes the above messages irrelevant.

    When changing the data in colum F (F4, F6, F8), Columns K, L, M will change the fill color. You can see this when changing F4. The changes in Columns K,L,M are conditional formatting. For Example, K4 has this =OR($F$4="MT/G7", $F$4="NCA", $F$4="AHS", $F$4="H2", $F$4="Shuttle"). Every second row needs this conditional formating. So K4, K6 & K8, need this. But the problem is that I haven't found an easy way to duplicate this forumla. I have to copy K4, paste into K6, then slight change the formula in K6 so that it's relevant for that row. So the forumla would change too =OR($F$6="MT/G7", $F$6="NCA", $F$6="AHS", $F$6="H2", $F$6="Shuttle"). This can become extremely time consuming. I wondering is there an easier way to condence this forumla down or another way?

    Thanks, sample.xlsx

  11. #11
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Conditional Formating and Formula Help

    Try this...

    Based on the sample file...

    Select the *entire* range K4:M9 starting from cell K4.
    Cell K4 will be the active cell. The active cell is the
    one cell in the selected range that is not shaded. The
    formula will be relative to the active cell.

    Conditional Formatting

    Use this formula:

    =AND(MOD(ROW(),2)=0,OR($F4="MT/G7",$F4="NCA",$F4="AHS",$F4="H2",$F4="Shuttle"))

  12. #12
    Registered User
    Join Date
    09-17-2013
    Location
    Edmonton
    MS-Off Ver
    Excel 2007
    Posts
    47

    Re: Conditional Formating and Formula Help

    Awesome! That did it :D thanks a lot

    If your able to... can you explain how that formula worked?

  13. #13
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Conditional Formating and Formula Help

    You want to format every other row and the rows to format are even numbered rows.

    We're testing that the row number is an even number:

    MOD(ROW(),2)=0

    With even numbered rows MOD(ROW(),2) will return 0. The odd numbered rows will return 1.

    So, we test that the row number is an even number AND if cell F4 contains one of the values of interest.

  14. #14
    Registered User
    Join Date
    09-17-2013
    Location
    Edmonton
    MS-Off Ver
    Excel 2007
    Posts
    47

    Re: Conditional Formating and Formula Help

    Hey Again,

    I tried implementing the same formula above into another section of the workbook. I took it as far as i could. It's funcionting about 80%... but it's duplicating the results for every row. if you see in the attached sample... How do i make it so that it only applies to the single row.

    Thanks
    Attached Files Attached Files

  15. #15
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Conditional Formating and Formula Help

    Refresh my memory and tell me what range you're wanting to highlight.

  16. #16
    Registered User
    Join Date
    09-17-2013
    Location
    Edmonton
    MS-Off Ver
    Excel 2007
    Posts
    47

    Re: Conditional Formating and Formula Help

    Sorry, i dont think that attachment was 100%. I've attached a new one. I want Cells F5, F7, F9, etc.... highlighted. I've got it working, but it's highlighting all of the cells. So for example, if C4=CMA & F4 = MT/G7, then only F5 should be red. Not F5 & F7 & F9....etc.
    Attached Files Attached Files

  17. #17
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Conditional Formating and Formula Help

    I think you need to make the cell references relative.

    From this:

    =AND(MOD(ROW(),2)=1,AND($C$4="CMA",$F$4="MT/G7"))

    To this:

    =AND(MOD(ROW(),2)=1,AND(C4="CMA",F4="MT/G7"))

  18. #18
    Registered User
    Join Date
    09-17-2013
    Location
    Edmonton
    MS-Off Ver
    Excel 2007
    Posts
    47

    Re: Conditional Formating and Formula Help

    There we go! I should have caught that... thanks! Learning tons!

  19. #19
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Conditional Formating and Formula Help

    Good deal. Thanks for the feedback!

  20. #20
    Registered User
    Join Date
    09-17-2013
    Location
    Edmonton
    MS-Off Ver
    Excel 2007
    Posts
    47

    Re: Conditional Formating and Formula Help

    Not sure if you'd be able to provide some help on my other post.

    http://www.excelforum.com/excel-prog...html?p=3419157

    Thanks

  21. #21
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Conditional Formating and Formula Help

    Sorry, not much of a programmer.

    Good luck on that one!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 4
    Last Post: 01-23-2014, 10:14 AM
  2. [SOLVED] Conditional formating formula
    By awest181 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 08-08-2013, 11:34 AM
  3. If Formula and Conditional Formating
    By AznDragon533 in forum Excel General
    Replies: 1
    Last Post: 04-04-2011, 11:50 PM
  4. Conditional formating-What formula do i need to use in conditional formating
    By warrima in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-07-2009, 12:33 AM
  5. [SOLVED] Formula for Conditional Formating - Help!
    By Mark Campbell in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-26-2006, 03:00 AM

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