Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Checking cells for 2 conditions

Hi,
I hope someone can help me with this. I have four cells A1:A4. If all four
cells contain data or are blank then thats okay. But if 1, 2 or 3 cells
contain data then I want a warning that all cells must be blank or contain
data.

Thanks
Mary


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default Checking cells for 2 conditions

Try this:

=IF(AND(COUNTA(A1:A4)0,COUNTA(A1:A4)<4),"Incorrec t entries","")

Change the wording of "Incorrect entries" to whatever message you
would like.

Hope this helps.

Pete

On Jul 21, 2:07 am, "Mary Lancaster" wrote:
Hi,
I hope someone can help me with this. I have four cells A1:A4. If all four
cells contain data or are blank then thats okay. But if 1, 2 or 3 cells
contain data then I want a warning that all cells must be blank or contain
data.

Thanks
Mary



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Checking cells for 2 conditions

One way.

You can use a formula like this in, say, B4:

=IF(OR(COUNTA(A1:A4)=4,COUNTBLANK(A1:A4)=4),"","Al l 4 cells must be either
filled or left empty")

Maybe give it a bold red font.

--
Biff
Microsoft Excel MVP


"Mary Lancaster" wrote in message
...
Hi,
I hope someone can help me with this. I have four cells A1:A4. If all four
cells contain data or are blank then thats okay. But if 1, 2 or 3 cells
contain data then I want a warning that all cells must be blank or contain
data.

Thanks
Mary



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,231
Default Checking cells for 2 conditions

"Mary Lancaster" wrote...
I hope someone can help me with this. I have four cells A1:A4. If all four
cells contain data or are blank then thats okay. But if 1, 2 or 3 cells
contain data then I want a warning that all cells must be blank or contain
data.


More alternatives,

=IF(ABS(COUNTA(A1:A4)-2)<2,"A1:A4 partially filled","")

=IF(AND(COUNTIF(A1:A4,{"=";"<"})<4),"A1:A4 partially filled","")


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
shade cells based on conditions - i have more than 3 conditions Mo2 Excel Worksheet Functions 3 March 30th 07 07:19 AM
Checking the Cells in Sheet1 with Cells in Sheet2 and replace Checking the cells in Sheet1 with Sheet2 Excel Worksheet Functions 1 August 19th 06 09:29 AM
checking two conditions Tmian Excel Discussion (Misc queries) 5 August 9th 06 12:02 AM
Checking if 2 of 3 conditions are met... guilbj2 Excel Discussion (Misc queries) 5 June 29th 06 04:31 PM
Checking that any cells are null RFJ Excel Worksheet Functions 5 June 21st 05 01:21 PM


All times are GMT +1. The time now is 10:14 PM.

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"