Solved

excel formatting

Posted on 2016-09-13
5
43 Views
Last Modified: 2016-09-13
I have an excel spreadsheet that has thousands of billing line items.
Column A lists the accountnumber and it is ordered by accountnumber.... low to high

so for example..... account 1111 might have 3 rows.  one row for each billing line item... ie... phone bill, garbage bill, sewer bill
account 2222 might only have 2 rows...   electric bill, garbage bill

i'd like to color the rows with a ledger style row color... by account.
meaning   account 1111... its 3 rows would be light green
account 2222's 2 rows would be white
account 3333's rows would revert back to light green.

is there a way to do this.  I really don't care what colors they are... just as long as they are light and transparent
attached is a manually created file that looks like what I am talking about.
experts-help.xlsx
0
Comment
Question by:jamesmetcalf74
  • 2
  • 2
5 Comments
 
LVL 32

Accepted Solution

by:
Rob Henson earned 500 total points
ID: 41796227
You can do that with Conditional formatting.

Insert a column to the left of the data, making this column A.

In A2 type 1 and then in the rest of column A have the following formula:

=IF(B3=B2,A2,-A2)

Copied down, this will alternate between 1 and -1 for each account.

Then for the conditional formatting:

Select all the data, excluding headers
Click on Home Ribbon > Conditional Fomatting and Choose New Rule
Select Use a formula to determine which cells to format
Enter formula =$A2=1   (note use of $ for column A, if you have used a different column adjust that)
Format as required for one colour eg pale green fill
Click OK

Assuming the cells are currently just white/no fill, only those with 1 in column A will now be pale green.
1
 

Author Comment

by:jamesmetcalf74
ID: 41796262
that worked like a charm but....   when i delete column a (the 1 and -1 column)  the formatting disappears.

which makes sense since it is formatting off that data.
is there a way to make the formatting stick and delete the column i am using.
0
 
LVL 32

Expert Comment

by:Rob Henson
ID: 41796267
Simple answer is no, just hide it instead.
0
 

Author Closing Comment

by:jamesmetcalf74
ID: 41796273
Thanks Rob-
This will make working with the data much easier
0
 
LVL 29

Expert Comment

by:Subodh Tiwari (Neeraj)
ID: 41796293
Nice solution Rob! :)
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

805 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question