Using Conditional formatting with subtotals

xcelguru

New Member
Joined
Nov 21, 2011
Messages
2
I am trying to work out a spreadsheet that I am using conditional formatting to highlight every two rows. I have 2 lines for each item and i need them to be grouped together. I can get the formula =mod(row(),4)<2
to do this, but then when i go to add the subtotals for each section it screws up the lines that are highlighted. For instance.. I have 2 associates on this spreadsheet and i use the stubtotal function to see how many each of them did, But when having the every two lines highlighted with matching information, and then adding the subtotals, it screws up the matching highlighted lines.. Is there anyway to fix it?



 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Without subtotals applied, doesn't your mod formula need to be [=mod(row(),4)< =2]? (Ignore the space after the less than sign)

When you apply subtotals, do you have just one item set per associate followed by a single subtotal line, or more than one item set followed by a single subtotal line??
 
Upvote 0
in my case, I have 2 associates, One has 10 rows, 5 sets of 2 information lines. the 2nd associate has 200 rows with 100 sets of information. I can use the conditional formatting to highlight the 2 rows, then skip two rows and so on.. But Once I put in the subtotals in, (which i will need because on other sheets, there is potential for more than 1 or 2 associates,) It messes up the sets being highlighted. the only thing I have seem to found that wont mess up the highlighting is adding a blank line inbetween the subtotal lines, but then it messes up on the filtering.. I guess I might be just trying to do too much on one sheet!
 
Upvote 0
You need to get away from row numbers and use a count of items by associate (irrespective of which rows these are in)

Assuming:
Row 1 contains the column headings
Column B contains your associate ID

I think this may do, or is close to, what you're after:
=MOD(COUNTIF(B$1:B1,B2),4)<2
 
Upvote 0

Forum statistics

Threads
1,214,644
Messages
6,120,709
Members
448,983
Latest member
Joaquim_Baptista

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top