Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Help needed: Conditional Formatting for 3 columns, any two of whichmust have data

I have 3 columns, A, B, and C. Each will accept input of exactly 6 alphanumeric characters. Two of the three must be populated.

The Conditional Formatting is used to highlight columns which are not compliant.

I've got one for the 6 characters required (spaces before and after the strings are ignored):

=OR(LEN(TRIM(A1))6,AND(LEN(TRIM(B1))0,LEN(TRIM(C 1))<6))

And I've got formulas for error states when none or all of the columns are populated:

=AND(LEN(TRIM(A1))=0,LEN(TRIM(B1))=0,LEN(TRIM(C1)) =0)

=AND(LEN(TRIM(A1))0,LEN(TRIM(B1))0,LEN(TRIM(C1)) 0)

But my formula for ensuring that 2 of the columns are populated gets fooled by spaces in the columns, which should be ignored:

=COUNTBLANK(A1:C1)<2

My only alternative that i can think of is to do a fairly complicated AND OR formula with all of the acceptable combinations of the 3 columns.

I'm guessing there's a much more elegant, simple option?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,872
Default Help needed: Conditional Formatting for 3 columns, any two of which must have data

Hi Pete,

Am Thu, 7 Jan 2016 21:53:00 -0800 (PST) schrieb pete:

I have 3 columns, A, B, and C. Each will accept input of exactly 6 alphanumeric characters. Two of the three must be populated.

The Conditional Formatting is used to highlight columns which are not compliant.


select A1:C to the end
Conditional Formatting:

=SUM(LEN(TRIM($A1:$C1)))<12


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,872
Default Help needed: Conditional Formatting for 3 columns, any two of which must have data

hi Pete,

Am Thu, 7 Jan 2016 21:53:00 -0800 (PST) schrieb pete:

I have 3 columns, A, B, and C. Each will accept input of exactly 6 alphanumeric characters. Two of the three must be populated.


you also can use the Data Validation to check the text length in the
columns
DV = Custom: =LEN(TRIM(A1))=6

Then you can select A1:C to the end and use
=COUNTA($A1:$C1)<3
into CF


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Help needed: Conditional Formatting for 3 columns, any two ofwhich must have data

On Friday, January 8, 2016 at 1:02:31 AM UTC-8, Claus Busch wrote:
Hi Pete,

Am Thu, 7 Jan 2016 21:53:00 -0800 (PST) schrieb pete:

I have 3 columns, A, B, and C. Each will accept input of exactly 6 alphanumeric characters. Two of the three must be populated.

The Conditional Formatting is used to highlight columns which are not compliant.


select A1:C to the end
Conditional Formatting:

=SUM(LEN(TRIM($A1:$C1)))<12


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional


Thanks Claus! I wasn't able to get "SUM" working here, but used "SUMPRODUCT" instead, which seems to do the trick :)

thanks again!
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Conditional formatting Help Needed Raz Excel Discussion (Misc queries) 3 March 3rd 09 05:25 PM
Conditional formatting help needed TGV Excel Discussion (Misc queries) 10 February 10th 09 05:58 PM
conditional formatting help needed learning quickly Excel Discussion (Misc queries) 2 September 10th 07 09:35 PM
Conditional Formatting in one column using data in two columns Renee Excel Worksheet Functions 4 February 22nd 06 06:58 PM
Conditional Formatting Help Needed... John Excel Programming 0 July 6th 04 10:36 PM


All times are GMT +1. The time now is 02:48 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"