Thanks Thanks:  0
Likes Likes:  0
Page 1 of 2 12 LastLast
Results 1 to 10 of 17

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

  1. #1
    New Member
    Join Date
    Feb 2011
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

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

    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?

  2. #2
    Board Regular MrKowz's Avatar
    Join Date
    Jun 2008
    Location
    St. Louis, MO
    Posts
    6,648
    Post Thanks / Like
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Formula for "If blank then A, if not blank then B"

    Welcome to the forums!

    Try:

    =IF(ISBLANK(B1),A1,B1)
    - Posting guidelines, forum rules and terms of use
    - Try searching for your answer first, see how
    - Read the FAQs
    - List of BB codes
    - Please use [CODE] [/CODE] tags when posting your VBA code. It retains spacing, so your code is easier to read, and therefore easier to debug.
    - Please back up your file before using any macros suggested!

  3. #3
    New Member
    Join Date
    Feb 2011
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Formula for "If blank then A, if not blank then B"

    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.

  4. #4
    New Member
    Join Date
    Feb 2015
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Formula for "If blank then A, if not blank then B"

    Thanks for your valuable Support

  5. #5
    New Member
    Join Date
    Mar 2015
    Posts
    1
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up Re: Formula for "If blank then A, if not blank then B"

    Quote Originally Posted by MrKowz View Post
    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

  6. #6
    New Member
    Join Date
    Feb 2016
    Posts
    5
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Formula for "If blank then A, if not blank then B"

    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

  7. #7
    MrExcel MVP Jonmo1's Avatar
    Join Date
    Oct 2006
    Location
    Bryan, TX
    Posts
    44,054
    Post Thanks / Like
    Mentioned
    18 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Formula for "If blank then A, if not blank then B"

    Try

    =A1-IF(B1="",TODAY(),B1)
    Use the MrExcel HTML Maker to post nicely formatted tables in your forum posts.
    Find a link in post number 31

    The more we learn, and the better we get at our trade, the easier it becomes to overlook the obvious.

    Life moves pretty fast. If you don't stop and look around once in a while, you could miss it.
    Ferris Bueller A.K.A. John Hughes, 1986

  8. #8
    New Member
    Join Date
    Feb 2016
    Posts
    5
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Formula for "If blank then A, if not blank then B"

    Quote Originally Posted by Jonmo1 View Post
    Try

    =A1-IF(B1="",TODAY(),B1)
    Thanks! Can I add a condition that if A1 is nothing occurs?

  9. #9
    New Member
    Join Date
    Feb 2016
    Posts
    5
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Formula for "If blank then A, if not blank then B"

    Quote Originally Posted by dauerad View Post
    Thanks! Can I add a condition that if A1 is nothing occurs?
    Can I add a condition that if A1 is empty, nothing occurs?

  10. #10
    MrExcel MVP Jonmo1's Avatar
    Join Date
    Oct 2006
    Location
    Bryan, TX
    Posts
    44,054
    Post Thanks / Like
    Mentioned
    18 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Formula for "If blank then A, if not blank then B"

    Try
    =IF(A1="","",A1-IF(B1="",TODAY(),B1))
    Use the MrExcel HTML Maker to post nicely formatted tables in your forum posts.
    Find a link in post number 31

    The more we learn, and the better we get at our trade, the easier it becomes to overlook the obvious.

    Life moves pretty fast. If you don't stop and look around once in a while, you could miss it.
    Ferris Bueller A.K.A. John Hughes, 1986

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •