Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Brendan J Cuffe
 
Posts: n/a
Default Conditional Formula

Can anyone help with the following: -

I have data in cells A2 and A3, in another cell (A10) I need a formula so
that

If there are no values in A2 or A3 the value shown in A10 will be zero and
if there are values in both A2 and A3, A10 will show the average of A2 and
A3 (as in (A2+A3)/2) but if there is a value in A2 and no value in A3 (or
visa versa), A10 shows the value in A2 (or A3) without entering the average
of the two cells.

Regards,
Brendan


  #2   Report Post  
Elliot J
 
Posts: n/a
Default

Try this, assuming you are using number values in your cells, ie: using
a zero (0) instead of an empty cell.

=IF(A2<0,IF(A3<0,((A2+A3)/2),A2),IF(A3<0,A3,0))

No doubt there is a more elegant solution, but I'm pretty crap with
maths and formula logic... well, and Excel formulas in general.

It seemed to work for me though!

Ell

  #3   Report Post  
Mangesh Yadav
 
Posts: n/a
Default

simple use the formula:
=AVERAGE(A2:A3)

Your formula (A2+A3)/2 considers empty cells as legal values. Whereas the
AVERAGE function does not consider blank cells.

- Mangesh



"Brendan J Cuffe" wrote in message
...
Can anyone help with the following: -

I have data in cells A2 and A3, in another cell (A10) I need a formula so
that

If there are no values in A2 or A3 the value shown in A10 will be zero and
if there are values in both A2 and A3, A10 will show the average of A2 and
A3 (as in (A2+A3)/2) but if there is a value in A2 and no value in A3 (or
visa versa), A10 shows the value in A2 (or A3) without entering the

average
of the two cells.

Regards,
Brendan




  #4   Report Post  
Bob Phillips
 
Posts: n/a
Default

=IF(AND(A2="",A3=""),"",AVERAGE(A2:A3))

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Brendan J Cuffe" wrote in message
...
Can anyone help with the following: -

I have data in cells A2 and A3, in another cell (A10) I need a formula so
that

If there are no values in A2 or A3 the value shown in A10 will be zero and
if there are values in both A2 and A3, A10 will show the average of A2 and
A3 (as in (A2+A3)/2) but if there is a value in A2 and no value in A3 (or
visa versa), A10 shows the value in A2 (or A3) without entering the

average
of the two cells.

Regards,
Brendan




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
How to combine conditional format with formula ? merlin68 Excel Worksheet Functions 4 April 14th 05 03:24 AM
Office2000: Conditional format behaves strangely Arvi Laanemets Excel Discussion (Misc queries) 1 April 7th 05 08:47 AM
conditional formatting formula Jack Sons Excel Discussion (Misc queries) 6 April 5th 05 09:50 AM
Formula Dependant Conditional Formatting LDanix Excel Discussion (Misc queries) 1 January 13th 05 06:50 PM
Help with macro formula and variable Huge project Excel Worksheet Functions 0 December 28th 04 01:27 AM


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