Returning one of two values in Microsoft Excel 2003

M

Mags

I am trying to allocate values across various headings in my worksheet.

In, say, A2, data is input via drop down box. Depending on the value of
this entry, and on entering a value in B2, B2's value is allocated to a cell
under a general heading via the formula =IF(OR(A2="value1", A2="value2",
A2="value3"), B2, " ") This is an income allocation spreadsheet.

My problem comes in my outgoings. Once again data is input via drop down
box and depending on these values I have to allocate my outgoings whether the
currency value is input in cell B2 or C2. So if B2 <>0 and C2=" ", B2 will
be allocated to a general heading, but if B2=" " and C2<>0, then the value in
C2 is to be allocated.

I'm new to these forums and I apologise if I have not been very succinct!

Can someone unbefuddle me please and help me with a formula?

Thank you.
 
B

Bernard Liengme

I would be very careful with your formula
=IF(OR(A2="value1", A2="value2", A2="value3"), B2, " ")
The final argument palces a singme space into the cell, normally users like
to use
=IF(OR(A2="value1", A2="value2",A2="value3"), B2, "")
with nothing between the two double-quotes

A formula to handle: So if B2 <>0 and C2=" ", B2 will be allocated to a
general heading,
but if B2=" " and C2<>0, then the value in C2 is to be allocated:
=IF(AND(B2<>0,C2=" "),B2,IF(AND(B2=" " and C2<>0),C2, "neither")

You need to be sure that C2 or B2 actually has a single space and not a
non-string
If this formula does not work, then try with the empty string test
=IF(AND(B2<>0,C2=""),B2,IF(AND(B2="" and C2<>0),C2, "neither")

best wishes
 

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