If..else..then statement

J

Jeff Metcalf

I'm trying to write this compare statement, but I keep getting errors about
to many arguements:

In Cell C20
IF C10=0, then C15
ElseIF C15=0, then C10
ElseIF C15=0 and C10=0
then
Average(C10,C15)
Else 0

Thanks in advance
 
M

Mike H

Jeff,

table for all the possible commbinations of C10 & c15 looks like this

c10 c15 answer
1 0 0.5
0 1 0.5
0 0 0
1 1 1

From your description I belive the answer in each case is as indicated above
so

=average(c10,c15)

should work

Mike
 
M

Mike H

Hi,

I should have added that if this is wrong please put the answers you expect
in each case.

Mike
 
J

Jeff Metcalf

Sorry, this is what I what....

c10 c15 answer
1 0 1
0 1 1
0 0 0
1 1 1
5 2 3.5

Thanks
 
M

Mike H

I'm confused about averaging 2 zero cells and why you started a new thread
but try this

=IF(C10=0,C15,IF(C15=0,C10,AVERAGE(C10,C15)))

Mike
 
J

Jeff Metcalf

I didn't start 2 threads...I don't know how that happened.

I'm not trying to average 2 zero cells really...I just want it to show 0 if
the corresponding cells are both 0.

The sheet calculates profit margin from 2 different areas of work. So if
they salesperson only has things in the 'write in' area, then I only want to
show that margin percentage. If he only has items in the DB connected area,
then I only want it to show that margin. But if he has items in both areas,
then I need the profit margin calculated from both.

Maybe I'm going about this wrong?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top