Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 290
Default tricky formula

Hi Guys,

been a while since ive been on here!

I am trying to work out a tricky formula...I will attempt to paste an
example below.


Header1 Header2 Header3 Formula Values
1
Date Date 1
Date Date Date 1
Date Date 0
Date 0


Now if header 1 2 and 3 are blank then I want a result of 1 from my
formula, if there are dates in all columns then I want a result of 1,
and same if only B column is blank (or header2), but then if 3 is blank
or 3 + 2 are blank then I want a result of 0.


Any ideas?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default tricky formula

=--(OR(COUNTIF(A2:C2,"")=3,AND(AND(ISNUMBER(A2),ISNUM BER(C2)),OR(ISNUMBER(B2
),ISBLANK(B2)))))

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Duncan" wrote in message
oups.com...
Hi Guys,

been a while since ive been on here!

I am trying to work out a tricky formula...I will attempt to paste an
example below.


Header1 Header2 Header3 Formula Values
1
Date Date 1
Date Date Date 1
Date Date 0
Date 0


Now if header 1 2 and 3 are blank then I want a result of 1 from my
formula, if there are dates in all columns then I want a result of 1,
and same if only B column is blank (or header2), but then if 3 is blank
or 3 + 2 are blank then I want a result of 0.


Any ideas?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 290
Default tricky formula

Hi Bob,

Thanks for your swift reply, but I pasted it straight in and came up
with an error, am i missing something?

Many thanks

Duncan


Bob Phillips wrote:
=--(OR(COUNTIF(A2:C2,"")=3,AND(AND(ISNUMBER(A2),ISNUM BER(C2)),OR(ISNUMBER(B2
),ISBLANK(B2)))))

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Duncan" wrote in message
oups.com...
Hi Guys,

been a while since ive been on here!

I am trying to work out a tricky formula...I will attempt to paste an
example below.


Header1 Header2 Header3 Formula Values
1
Date Date 1
Date Date Date 1
Date Date 0
Date 0


Now if header 1 2 and 3 are blank then I want a result of 1 from my
formula, if there are dates in all columns then I want a result of 1,
and same if only B column is blank (or header2), but then if 3 is blank
or 3 + 2 are blank then I want a result of 0.


Any ideas?


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 290
Default tricky formula

Like the novice that I am I changed it to

=(OR(COUNTIF(A2:C2,"")=3,AND(AND(ISNUMBER(A2),ISNU MBER(C2)),OR(ISNUMBER(B2),ISBLANK(B2)))))

But that brings up true or false and i want it to bring up a 1 or a 0,
also doesnt bring up the true or false in the right contexts..... I
think I am being stupid.....







Duncan wrote:
Hi Bob,

Thanks for your swift reply, but I pasted it straight in and came up
with an error, am i missing something?

Many thanks

Duncan


Bob Phillips wrote:
=--(OR(COUNTIF(A2:C2,"")=3,AND(AND(ISNUMBER(A2),ISNUM BER(C2)),OR(ISNUMBER(B2
),ISBLANK(B2)))))


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Duncan" wrote in message
oups.com...
Hi Guys,

been a while since ive been on here!

I am trying to work out a tricky formula...I will attempt to paste an
example below.


Header1 Header2 Header3 Formula Values
1
Date Date 1
Date Date Date 1
Date Date 0
Date 0


Now if header 1 2 and 3 are blank then I want a result of 1 from my
formula, if there are dates in all columns then I want a result of 1,
and same if only B column is blank (or header2), but then if 3 is blank
or 3 + 2 are blank then I want a result of 0.


Any ideas?


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 290
Default tricky formula

Ok, I was being stupid, I pasted it in again correctly and it reads

=--(OR(COUNTIF(A2:C2,"")=3,AND(AND(ISNUMBER(A2),ISNUM BER(C2)),OR(ISNUMBER(B2),ISBLANK(B2)))))

But it works for when all 3 are balnk, but shows 0 for all other
combinations....




Duncan wrote:
Like the novice that I am I changed it to

=(OR(COUNTIF(A2:C2,"")=3,AND(AND(ISNUMBER(A2),ISNU MBER(C2)),OR(ISNUMBER(B2),ISBLANK(B2)))))

But that brings up true or false and i want it to bring up a 1 or a 0,
also doesnt bring up the true or false in the right contexts..... I
think I am being stupid.....







Duncan wrote:
Hi Bob,

Thanks for your swift reply, but I pasted it straight in and came up
with an error, am i missing something?

Many thanks

Duncan


Bob Phillips wrote:
=--(OR(COUNTIF(A2:C2,"")=3,AND(AND(ISNUMBER(A2),ISNUM BER(C2)),OR(ISNUMBER(B2
),ISBLANK(B2)))))


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Duncan" wrote in message
oups.com...
Hi Guys,

been a while since ive been on here!

I am trying to work out a tricky formula...I will attempt to paste an
example below.


Header1 Header2 Header3 Formula Values
1
Date Date 1
Date Date Date 1
Date Date 0
Date 0


Now if header 1 2 and 3 are blank then I want a result of 1 from my
formula, if there are dates in all columns then I want a result of 1,
and same if only B column is blank (or header2), but then if 3 is blank
or 3 + 2 are blank then I want a result of 0.


Any ideas?




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 290
Default tricky formula

Ok, I am really embarressed now, Bob's suggestion worked perfectly, I
have got tuesday morning blues and had an error in my tests and not
with the formula,

I am extremely sorry Bob, I should have know that it would work coming
from you!

Many thanks again,

Duncan



Duncan wrote:
Ok, I was being stupid, I pasted it in again correctly and it reads

=--(OR(COUNTIF(A2:C2,"")=3,AND(AND(ISNUMBER(A2),ISNUM BER(C2)),OR(ISNUMBER(B2),ISBLANK(B2)))))

But it works for when all 3 are balnk, but shows 0 for all other
combinations....




Duncan wrote:
Like the novice that I am I changed it to

=(OR(COUNTIF(A2:C2,"")=3,AND(AND(ISNUMBER(A2),ISNU MBER(C2)),OR(ISNUMBER(B2),ISBLANK(B2)))))

But that brings up true or false and i want it to bring up a 1 or a 0,
also doesnt bring up the true or false in the right contexts..... I
think I am being stupid.....







Duncan wrote:
Hi Bob,

Thanks for your swift reply, but I pasted it straight in and came up
with an error, am i missing something?

Many thanks

Duncan


Bob Phillips wrote:
=--(OR(COUNTIF(A2:C2,"")=3,AND(AND(ISNUMBER(A2),ISNUM BER(C2)),OR(ISNUMBER(B2
),ISBLANK(B2)))))


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Duncan" wrote in message
oups.com...
Hi Guys,

been a while since ive been on here!

I am trying to work out a tricky formula...I will attempt to paste an
example below.


Header1 Header2 Header3 Formula Values
1
Date Date 1
Date Date Date 1
Date Date 0
Date 0


Now if header 1 2 and 3 are blank then I want a result of 1 from my
formula, if there are dates in all columns then I want a result of 1,
and same if only B column is blank (or header2), but then if 3 is blank
or 3 + 2 are blank then I want a result of 0.


Any ideas?


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default tricky formula

Luckily I went out Duncan, so I didn't see these until you had resolved it
all <BG

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Duncan" wrote in message
ups.com...
Ok, I am really embarressed now, Bob's suggestion worked perfectly, I
have got tuesday morning blues and had an error in my tests and not
with the formula,

I am extremely sorry Bob, I should have know that it would work coming
from you!

Many thanks again,

Duncan



Duncan wrote:
Ok, I was being stupid, I pasted it in again correctly and it reads


=--(OR(COUNTIF(A2:C2,"")=3,AND(AND(ISNUMBER(A2),ISNUM BER(C2)),OR(ISNUMBER(B2
),ISBLANK(B2)))))

But it works for when all 3 are balnk, but shows 0 for all other
combinations....




Duncan wrote:
Like the novice that I am I changed it to


=(OR(COUNTIF(A2:C2,"")=3,AND(AND(ISNUMBER(A2),ISNU MBER(C2)),OR(ISNUMBER(B2),
ISBLANK(B2)))))

But that brings up true or false and i want it to bring up a 1 or a 0,
also doesnt bring up the true or false in the right contexts..... I
think I am being stupid.....







Duncan wrote:
Hi Bob,

Thanks for your swift reply, but I pasted it straight in and came up
with an error, am i missing something?

Many thanks

Duncan


Bob Phillips wrote:

=--(OR(COUNTIF(A2:C2,"")=3,AND(AND(ISNUMBER(A2),ISNUM BER(C2)),OR(ISNUMBER(B2
),ISBLANK(B2)))))


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Duncan" wrote in message
oups.com...
Hi Guys,

been a while since ive been on here!

I am trying to work out a tricky formula...I will attempt to

paste an
example below.


Header1 Header2 Header3 Formula Values
1
Date Date 1
Date Date Date 1
Date Date 0
Date 0


Now if header 1 2 and 3 are blank then I want a result of 1 from

my
formula, if there are dates in all columns then I want a result

of 1,
and same if only B column is blank (or header2), but then if 3

is blank
or 3 + 2 are blank then I want a result of 0.


Any ideas?




  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 290
Default tricky formula

Hi Bob,

I wonder if you have the time to break this formula down for me and
explain how it works? that way I might be able to recreate it at
another time with the knowledge instead of just copying the formula.

I do have a basic understanding of formulas and maths but working out
how your formula works is giving me a headache!

Many many thanks

Duncan


Bob Phillips wrote:
Luckily I went out Duncan, so I didn't see these until you had resolved it
all <BG

--


  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default tricky formula

Duncan,

It is quite straight-forward, I just put all of your logic into separate
groups

OR(COUNTIF(A2:C2,"")=3 will test fro all blank

AND(ISNUMBER(A2),ISNUMBER(C2)) tests for column A and C being a date
(actually just a number, but Excel doesn't have a date type)

OR(ISNUMBER(B2),ISBLANK(B2)) tests for B being a date or blank

we join the last two with an AND,

AND(AND(ISNUMBER(A2),ISNUMBER(C2)),OR(ISNUMBER(B2) ,ISBLANK(B2))))

so we effectively test for A being a date, B being a date OR blank, and C
being a date

Combining this with OR

OR(COUNTIF(A2:C2,"")=3,AND(AND(ISNUMBER(A2),ISNUMB ER(C2)),OR(ISNUMBER(B2),IS
BLANK(B2))))

tests for all blank, OR A being a date, B being a date OR blank, and C being
a date

This would just return TRUE or FALSE, so we need to coerce it to 1 or 0,
this is what the leading -- does.


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Duncan" wrote in message
ups.com...
Hi Bob,

I wonder if you have the time to break this formula down for me and
explain how it works? that way I might be able to recreate it at
another time with the knowledge instead of just copying the formula.

I do have a basic understanding of formulas and maths but working out
how your formula works is giving me a headache!

Many many thanks

Duncan


Bob Phillips wrote:
Luckily I went out Duncan, so I didn't see these until you had resolved

it
all <BG

--




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
Tricky Formula steph44haf Excel Worksheet Functions 4 September 18th 06 08:53 PM
Tricky Formula andrewc Excel Discussion (Misc queries) 22 July 20th 06 11:39 AM
Help with a tricky formula...... nevi Excel Discussion (Misc queries) 1 May 31st 06 10:39 PM
Tricky formula Steve Excel Discussion (Misc queries) 3 April 17th 06 05:06 PM
tricky formula.. please help Aaron H[_3_] Excel Programming 6 January 15th 06 12:36 AM


All times are GMT +1. The time now is 02:23 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"