Formula for "If blank then A, if not blank then B"

cvvveu

New Member
Joined
Feb 7, 2011
Messages
2
I have two columns in my spreadsheet. Column A has no blank fields, Column B has some blank fields. I would like to show the text from Column A in the same row of Column B only when Column B is blank.

So, basically I'm after: If column B has text, do nothing. If column B is blank, then list text from Column A.

Right now I've created Column C with this formula =IF(ISBLANK(B1), A1. That's working to get the text from A1 when B1 is blank. What can I do/add to get it pull the text from B1 if there is text there? Or...is there a better approach altogether?
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)

MrKowz

Well-known Member
Joined
Jun 30, 2008
Messages
6,653
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Welcome to the forums!

Try:

=IF(ISBLANK(B1),A1,B1)
 

cvvveu

New Member
Joined
Feb 7, 2011
Messages
2
That works. Thank you so much.

I stumbled upon =IF(b1="",a1,IF(ISTEXT(b1),b1)) but like yours better because it's shorter.

Thanks again.
 

Stimpygato

New Member
Joined
Mar 20, 2015
Messages
1
Welcome to the forums!

Try:

=IF(ISBLANK(B1),A1,B1)

Thank you MrKowz! I'm a small biz owner, web dev, and I must say that MrExcel.com has saved my butt numerous times. Always great and courteous help from contributers. I truly appreciate your great advice, almost daily ;)

~Stimpygato
 

dauerad

New Member
Joined
Feb 18, 2016
Messages
5
A slight twist...

Looking for a calculation to occur if a cell is blank. The cells either have a date in them or nothing.

If B1 has a value then subtract B1 from A1

If B1 is blank the subtract today's date from A1
 

Jonmo1

MrExcel MVP
Joined
Oct 12, 2006
Messages
44,061
Try

=A1-IF(B1="",TODAY(),B1)
 

Forum statistics

Threads
1,175,656
Messages
5,898,714
Members
434,724
Latest member
DJT

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
Top