IF AND OR Statement

Mike7792

New Member
Joined
Aug 7, 2018
Messages
2
Hello,

I'm sure it's relatively simple but I'm trying to do a formula whereby I can return the Ref no. in column C if there is cost in column A but no volume in Column B or vice versa. I want to try and do it all in one formula but when i try and add in the OR part of the statement, excel wants me to multiply by OR which makes it error. Basically if there are any instances where there are cost with no volume or volume with no cost, I'd like to return the reference in column C

CostVolumeRef
£2002AL001
£1004AL002
5AL003
£4006AL004
£180AL005

<tbody>
</tbody>

Any help would be appreciated.

Thanks
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Hi Mike,

If your Cost is in column A (formatted as "Currency") and Volume is in column B (formatted as "Number") then maybe try to do the following:
=IF(AND(A1*B1=0,SUM(A1:B1)<>0),"display ref number","do not display ref number")

Not sure how you want to display the Reference number - is it a lookup to another column?

Let me know if that works for you.

Best regards,
Justyna
 
Upvote 0
Hi Justyna,

Yes this works perfectly, thank you for taking the time to reply.

Have a great day

Mike
 
Upvote 0
Cool, glad to hear it works!

Take care,
Justyna
 
Upvote 0
Hi,

If Columns A and B are Numbers, use D2 formula copied down.
If Columns A or B might be Text, then use E2 formula copied down.


Book1
ABCDE
1CostVolumeRef
2$2002AL001  
3$1004AL002
45AL003AL003AL003
5$4006AL004
6$180AL005AL005AL005
Sheet165
Cell Formulas
RangeFormula
D2=IF(COUNT(A2:B2)=2,"",C2)
E2=IF(COUNTA(A2:B2)=2,"",C2)
 
Upvote 0

Forum statistics

Threads
1,215,003
Messages
6,122,655
Members
449,091
Latest member
peppernaut

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top