+ Reply to Thread
Results 1 to 6 of 6

Formula(s) to populate cells based on several criteria

  1. #1
    Registered User
    Join Date
    03-28-2024
    Location
    United States of Texas
    MS-Off Ver
    M365
    Posts
    2

    Formula(s) to populate cells based on several criteria

    I tried to search for this solution, but wasn't able to find it and I'm not even sure if I'm asking this the right way.

    I have a spreadsheet with an Employee ID column (Column B) and an Email address column (Column C). Not all users have an Employee ID, contractors only have an Email address, so I want to combine columns B and C in to column D. The caveat is column B has blanks, where the user is a contractor, but column C also has blanks. When I use this formula to combine them it works, except in the cases where there is an EID in column B and EMail in column C, it throws a "False" in the column D cell. =IF(C2="",TEXT(B2,"000000000"),IF(B2="",C2)). I have to format column B to provide the leading zeroes for the EID.

    Here's a sample of what I'm looking at.

    ExcelHelp.png

    Any help will be greatly appreciated!

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,847

    Re: Formula(s) to populate cells based on several criteria

    Welcome to the forum.

    What do you want in that column if BOTH columns are filled out?

    There are instructions at the top of the page explaining how to attach your sample workbook (yellow banner: HOW TO ATTACH YOUR SAMPLE WORKBOOK). Screenshots are of little practical use as we cannot manipulate them.

    A good sample workbook has just 10-20 rows of representative data that has been desensitised. The sample layout accurately matches that of your real data. It also has expected results mocked up, worked examples where required, relevant cells highlighted and a few explanatory notes.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,847

    Re: Formula(s) to populate cells based on several criteria

    Try this:

    =IF(C2="",TEXT(B2,"000000000"),IF(B2="",C2,TEXT(B2,"000000000"))

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,728

    Re: Formula(s) to populate cells based on several criteria

    You haven't included a value_if_false clause for the IF functions. Perhaps you need something like this:

    =IF(B2="","",TEXT(B2,"000000000 ")&C2

    Hope this helps.

    Pete

  5. #5
    Registered User
    Join Date
    03-28-2024
    Location
    United States of Texas
    MS-Off Ver
    M365
    Posts
    2

    Re: Formula(s) to populate cells based on several criteria

    HOLY COW, that worked!!! What really stinks is I was so freaking close to getting to that formula last night, but after a 12 hour day of Excel and ELT preso prep I was mentally done.

    Thank you so much!!!

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,847

    Re: Formula(s) to populate cells based on several criteria

    Glad to have helped.

    If that takes care of your original question, please choose Thread Tools from the menu link above and mark this thread as SOLVED. You can also access the SOLVED tag by editing the opening post and choosing SOLVED from the drop-down to the left of the title box.

    Also, if you have not already done so, remember that you can reward anyone who offered you help towards a solution for your issue by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of each of those who offered help.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. populate cells based on multiple criteria
    By Alexmedft in forum Excel General
    Replies: 4
    Last Post: 05-26-2021, 05:04 PM
  2. Replies: 3
    Last Post: 08-03-2020, 02:17 PM
  3. [SOLVED] Help to automatically populate cells based on criteria
    By prudential in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-04-2018, 01:42 PM
  4. [SOLVED] Auto Populate Cells Based on a Criteria
    By danallamas in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-15-2017, 08:06 PM
  5. Populate cells based on 3 criteria.
    By danallamas in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-07-2015, 09:24 AM
  6. Using VBA to populate cells based on a criteria in another tab
    By mongoose36 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 08-07-2013, 02:12 PM
  7. [SOLVED] Populate Cells based on Criteria of Another Cell
    By mkeys4 in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 07-16-2013, 07:39 AM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1