+ Reply to Thread
Results 1 to 9 of 9

multiple column if statement

Hybrid View

  1. #1
    Registered User
    Join Date
    10-10-2014
    Location
    seattle wa
    MS-Off Ver
    2007
    Posts
    63

    multiple column if statement

    I am very new at doing formula in excel. How do I do a if statement that looks at multiple columns.


    Example:
    A B C
    Row1 1982
    Row2 1974
    Row 3 1982
    Row 4 1974

    I need a if statement first to read Column A , if there is year in column A then give me the year. If there is not year in column A then look at column B, if there is year in B then give that year, If no year in column B then look at C and then give me the year in C.

    Thank you
    Last edited by gill123; 07-06-2015 at 01:44 PM. Reason: example not showing up right

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,736

    Re: multiple column if statement

    Try ...

    Assumes only ONE date in any row in A to C

    =INDEX(A1:C1,,MAX(IF(--(A1:C1<>0),COLUMN(A1:C1),0)),1)

    Enter with Ctrl+Shift+Enter and copy down rows

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

    Re: multiple column if statement

    It is difficult to see what you have from your example, but if the columns are either empty or contain a year, and if there is only one column which is not empty in any one row, then you can do this:

    =--(A1&B1&C1)

    then copy down.

    Hope this helps.

    Pete

  4. #4
    Registered User
    Join Date
    10-10-2014
    Location
    seattle wa
    MS-Off Ver
    2007
    Posts
    63

    Re: multiple column if statement

    Pete_UK how do i display if there is blank cell. I keep getting #VALUE! for blank cells.

  5. #5
    Forum Contributor
    Join Date
    07-07-2014
    Location
    ericbartha.com
    MS-Off Ver
    2016 Professional
    Posts
    126

    Re: multiple column if statement

    I just read the other comments and John's solution is a lot better and more robust. I was just tyring to keep it simple. Just make sure you hit Ctrl+Shift+Enter.

    However, if there will NEVER be any value in the other cells, eg they really are always blank, and you a realllllly trying to keep it simple for some reason, you really could just do a SUM of MAX function... SUM(A2:C2) for example....

  6. #6
    Forum Contributor
    Join Date
    07-07-2014
    Location
    ericbartha.com
    MS-Off Ver
    2016 Professional
    Posts
    126

    Re: multiple column if statement

    What is the cell value of A2 if there is NO year? Is it blank or something else?

  7. #7
    Registered User
    Join Date
    10-10-2014
    Location
    seattle wa
    MS-Off Ver
    2007
    Posts
    63

    Re: multiple column if statement

    it is blank ericbartha

  8. #8
    Forum Contributor
    Join Date
    07-07-2014
    Location
    ericbartha.com
    MS-Off Ver
    2016 Professional
    Posts
    126

    Re: multiple column if statement

    Try this...

    =IF(SUM(A2,B2)=0,C2,IF(A2="",B2,A2))

  9. #9
    Registered User
    Join Date
    10-10-2014
    Location
    seattle wa
    MS-Off Ver
    2007
    Posts
    63

    Re: multiple column if statement

    Thank you every one for quick Reply!

+ 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. [SOLVED] SUMIFS statement needed to pull multiple data from the same column
    By onetoncrewcab in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-17-2014, 08:27 PM
  2. Replies: 7
    Last Post: 08-11-2014, 12:05 PM
  3. [SOLVED] If statement that will look among multiple criteria and generate a statement
    By liz5818 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-01-2013, 04:12 PM
  4. IF statement using multiple variables to give multiple outcomes
    By stujordan in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-06-2009, 06:46 AM
  5. Replies: 1
    Last Post: 04-10-2008, 11:47 AM

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