+ Reply to Thread
Results 1 to 6 of 6

If statement over multiple columns

  1. #1
    Registered User
    Join Date
    01-02-2014
    Location
    Cape Town
    MS-Off Ver
    Excel 2007
    Posts
    88

    If statement over multiple columns

    Hi, I'm not getting the result I want, pls can you assist - what am I doing wrong here

    =IF(B6:H6>"","Ok","error")

    thank you

  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,460

    Re: If statement over multiple columns

    Sorry, my crystal ball is away for servicing at the moment ...

    What's it meant to be doing? What are you getting? What do you want?
    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
    Registered User
    Join Date
    01-02-2014
    Location
    Cape Town
    MS-Off Ver
    Excel 2007
    Posts
    88

    Re: If statement over multiple columns

    lol, sorry
    if any of the cells from B6 to H6 are zero/empty it should flag an error

  4. #4
    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,460

    Re: If statement over multiple columns

    Try this:

    =IF(OR(COUNTIF(B6:H6,"")>0,COUNTIF(B6:H6,0)>0),"error","OK")

  5. #5
    Registered User
    Join Date
    01-02-2014
    Location
    Cape Town
    MS-Off Ver
    Excel 2007
    Posts
    88

    Re: If statement over multiple columns

    Perfect, 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,460

    Re: If statement over multiple columns

    No probs!

+ 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] COUNTIF with an OR Statement - Checking multiple columns for a value
    By mason0567 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-23-2019, 05:48 PM
  2. If/then statement that checks multiple columns then averages?
    By kixgil in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-17-2015, 10:50 PM
  3. Sumifs with or statement over multiple columns
    By sjennings007 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-07-2015, 11:05 PM
  4. Running If Statement on Multiple Columns ( for later Macro Use)
    By vrest in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-29-2012, 10:49 AM
  5. IF Statement: Dates in multiple columns
    By Swebb in forum Excel General
    Replies: 3
    Last Post: 04-27-2011, 04:18 PM
  6. [Solved] Insert Multiple columns in One Statement
    By djblois1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-11-2010, 03:19 PM
  7. IF Statement on multiple columns
    By sinspawn56 in forum Excel General
    Replies: 2
    Last Post: 07-28-2009, 12:02 PM

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