If And Statment to include three columns

fvisions

Board Regular
Joined
Jul 29, 2008
Messages
191
Office Version
  1. 365
Platform
  1. Windows
Hello, I am looking to expand a formula to include a third column. The current formula is; if(and(n2="",o2="")m2,n2), Basically I am trying to say if column N & O are blank then report the data in column M to the new column. If there is data in either column N or O then report this data instead of column M. There is only data in one or the other columns but not both.
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
How about
=IF(AND(N2="",O2=""),M2,IF(N2="",O2,N2))

or
=IF(N2<>"",N2,IF(O2<>"",O2,M2))
 
Last edited:
Upvote 0
Hi you will need to embed one IF fomular in the another..
=IF(AND(N2="",O2="")M2, IF(N2="",O2,N2)) - effectively you're saying if N and O are blank then report M, if they're not blank then look to see if N is blank, if N is blank then report O otherwise report N.. sort of a process of elimination! If there is any risk that you end up with data in more than one column then I would use multiple IF(AND statements to double check each time that only one column has data and to return "ERROR" if there is data in two columns ie.
=IF(AND(N2="",O2=""),M2, IF(AND(M2="",N2=""),O2,IF(AND(M2="",O2=""),N2,"ERROR")))
Suzanne
 
Upvote 0

Forum statistics

Threads
1,223,898
Messages
6,175,272
Members
452,628
Latest member
dd2

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