+ Reply to Thread
Results 1 to 10 of 10

Can you combine these two formulas?

  1. #1
    Forum Contributor
    Join Date
    06-28-2016
    Location
    Pennsylvania, USA
    MS-Off Ver
    2013
    Posts
    308

    Can you combine these two formulas?

    so I'm trying to make a rule that auto-colors every other category, and I came up with some formulas that work for it.

    However, since I am not very familiar with countif(), I haven't been able to come up with a way to nest them.

    I used:

    Please Login or Register  to view this content.
    in a helper column, then:

    Please Login or Register  to view this content.
    to color it in the conditional formatting. It works perfectly, but I am wondering if there's a way to do this without a helper column. I am open to revamping my formulas if there is a more efficient way to accomplish this also.
    Attached Files Attached Files
    Last edited by TheN; 08-17-2016 at 07:07 PM.

  2. #2
    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
    53,050

    Re: Can you combine these two formulas?

    Try this for the helper...
    =IF(A2=A1,B1,IF(B1=1,0,1))

    Then this for the CF...
    =$B2=1
    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

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

    Re: Can you combine these two formulas?

    No need for a helper.

    Conditional Formatting

    Use this formula:

    =MOD(SUMPRODUCT(--($A$1:$A1<>$A$2:$A2)),2)<1

    Hey, we've got an all PA thread going here!
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  4. #4
    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
    53,050

    Re: Can you combine these two formulas?

    Go Steelers lol

  5. #5
    Forum Contributor
    Join Date
    06-28-2016
    Location
    Pennsylvania, USA
    MS-Off Ver
    2013
    Posts
    308

    Re: Can you combine these two formulas?

    LOL

    didn't notice that until you pointed it out.

    Thanks for formulas.

    Tony, mind explaining how

    Please Login or Register  to view this content.
    returns the values it does? I see that it basically counts which division it is, but don't quite understand the logic behind that. Quite a neat little formula though, so I definitely want to understand it.

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

    Re: Can you combine these two formulas?

    Notice how the ranges are offset.

    So, it's counting how many cells are not equal to the cell below. For each group the count will be the same:

    Header
    x = 1
    x = 1
    y = 2
    z = 3
    z = 3
    z = 3

    Then we can test the count for even or odd and apply the format based on that condition.

  7. #7
    Forum Contributor
    Join Date
    06-28-2016
    Location
    Pennsylvania, USA
    MS-Off Ver
    2013
    Posts
    308

    Re: Can you combine these two formulas?

    Ah, genius, I understand the logic now, thanks!

    That will definitely come in handy in the future.

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

    Re: Can you combine these two formulas?

    You're welcome. Thanks for the feedback!

  9. #9
    Valued Forum Contributor
    Join Date
    06-21-2013
    Location
    Bangladesh
    MS-Off Ver
    Excel 2000, Excel XP, Excel 2002, Excel 2007, Excel 2010, Excel 2013
    Posts
    975

    Re: Can you combine these two formulas?

    You can use this formula in conditional formatting :

    Please Login or Register  to view this content.

  10. #10
    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
    53,050

    Re: Can you combine these two formulas?

    Happy to help and thanks for the feedback

+ 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. Can someone please help me combine 2 formulas??
    By daviddc114 in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 03-12-2013, 09:54 AM
  2. [SOLVED] Using Combine macro to combine multiple worksheets - need to modify to paste formulas
    By DLSmith in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-26-2012, 09:07 AM
  3. combine 2 formulas
    By jiunndar in forum Excel General
    Replies: 2
    Last Post: 01-21-2011, 02:44 AM
  4. Combine 2 formulas
    By Steved in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 06:05 PM
  5. Combine 2 formulas
    By Steved in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 PM
  6. Combine 2 formulas
    By Steved in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 10:05 AM
  7. Combine 2 formulas
    By Steved in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 AM
  8. Help combine 2 formulas into 1
    By Robert in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-01-2005, 04:06 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