+ Reply to Thread
Results 1 to 6 of 6

IF statement with four columns to choose from

Hybrid View

  1. #1
    Registered User
    Join Date
    04-27-2017
    Location
    New York
    MS-Off Ver
    MS 365 v2211
    Posts
    89

    IF statement with four columns to choose from

    Hello, I have spreadsheet with several columns for 'employee'. Let's call column B the current employee. Columns C, D and E may indicate a new employee taking over next year. What are some strategies for pulling the new employee name, if one exists, into a new column, otherwise pulling the current employee name into that cell, if no new employees exist?

    This is easy with two columns, because it's an IF statement with only two choices, but I don't see how to build three or more choices into the formula. An example is attached. Column F is what I'm trying to generate with a formula.

    Thank you,
    Attached Files Attached Files

  2. #2
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,466

    Re: IF statement with four columns to choose from

    Please try in F2 and copy down:
    Formula: copy to clipboard
    =IFERROR(CHOOSE(COUNTA(C2:E2)+1,B2,CONCAT(C2:E2)),"ERROR")
    Attached Files Attached Files

  3. #3
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,787

    Re: IF statement with four columns to choose from

    How about
    Formula: copy to clipboard
    =LET(a,TOCOL(C2:E2,1),IF(COUNT(ROWS(a))=0,B2,IF(ROWS(a)>1,"Error",a)))

  4. #4
    Registered User
    Join Date
    04-27-2017
    Location
    New York
    MS-Off Ver
    MS 365 v2211
    Posts
    89

    Re: IF statement with four columns to choose from

    These both do the trick. I think CountA is one of my blind spots as well as ToCol.

    Thank you,

  5. #5
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,787

    Re: IF statement with four columns to choose from

    Glad to help & thanks for the feedback.

  6. #6
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,466

    Re: IF statement with four columns to choose from

    You are Welcome! Thanks for the feedback and rep . Glad to have helped.

+ 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. Choose option 2 of IF Statement if cell is blank
    By ok0p0x in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-21-2021, 11:13 AM
  2. [SOLVED] if statement of 3 numbers choose last number
    By zzz444 in forum Excel General
    Replies: 5
    Last Post: 06-24-2020, 12:14 PM
  3. IF Statement * Choose Formula Help
    By jkjuliek in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-04-2019, 12:28 AM
  4. choose different columns with VBA
    By torti111 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-28-2017, 07:58 AM
  5. If statement to choose which part of macro to use
    By testestestt in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-04-2013, 12:31 PM
  6. Need help combining an IF statement and lookup, choose, or match functions
    By sixsteps268 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 05-20-2013, 03:28 PM
  7. If statement to choose from 2 drop down menus?
    By andrewsco in forum Excel General
    Replies: 3
    Last Post: 03-15-2007, 10:55 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