Solved

Color alternate excel rows based on duplicate numbering system.

Posted on 2013-01-29
2
472 Views
Last Modified: 2013-01-29
Hello Experts.

I have a Excel 2003 spreadsheet.  In Column A I have the numbering system below which will go beyond 150 by the end of the year.  I would like to use something like conditional formatting so each new number sequence is an alternate color (grey/white) across to Column AO. (Color in bracket for emphasis only)


1_2013 (white)
2_2013 (Grey)
2_2013 (Grey)
2_2013 (Grey)
2_2013 (Grey)
3_2013 (White)
4_2013 (Grey)
5_2013 (White)
6_2013 (Grey)
7_2013 (White)
7_2013 (White)
8_2013 (Grey)

etc, etc, etc

As soon as the number is entered, it colors that row to the alternate color to Column AO

Thank you in advance.

Matt
0
Comment
Question by:mattm2002
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 7

Accepted Solution

by:
Beneford earned 500 total points
ID: 38830175
Is it easy to extract a sequential number from column AO?
eg left(AO1,find("_",AO1)-1)

If so, you can use an even/odd formula in your conditional formatting.

I don't have Excel 2003, but in 2010, I can use the following formulae and have the two formulae covering the same range giving alternate colours as you specified.

=MOD(LEFT($A01,FIND("_",$A01)-1),2)=0
=MOD(LEFT($A01,FIND("_",$A01)-1),2)=1

If it's not easy to get a sequential number, then you could introduce a hidden column that checks AO34 against AO33 as follows:

=IF(A03=A02,B02,IF(B02="White","Grey","White"))

And then use column BO to determine the colour you want.
0
 

Author Comment

by:mattm2002
ID: 38830240
Thanks Beneford

I added your sequential suggestion to AP (given AO has data in it)

I did some more research based on your suggestion and found the following worked for 2003, coloring based on an even or odd number.

=AND(MOD($AP2,2)=0,$AP2<>"")
=AND(MOD($AP2,2)=1,$AP2<>"")

Worked like a charm, much appreciated.

Matt
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
This article describes a serious pitfall that can happen when deleting shapes using VBA.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

728 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