Solved

excel formatting

Posted on 2016-09-13
5
41 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 28

Expert Comment

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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Excel Graph of User occurance 9 27
Unable to open excel in 2016 is slow 4 21
Match formula returns N/A 5 25
Excel 2010 - Comparison of texts in a cell 14 29
INDEX and MATCH can be used to great effect to replace HLOOKUP and VLOOKUP as it does not have the limitation of needing the data to be sorted so that the reference value is in the first column or row. It also has the ability to perform a bi-directi…
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…

911 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now