+ Reply to Thread
Results 1 to 7 of 7

How to produce error if text is included in a sum

  1. #1
    Registered User
    Join Date
    08-12-2018
    Location
    Florida, USA
    MS-Off Ver
    10
    Posts
    1

    How to produce error if text is included in a sum

    I am trying to write a sum for a column but i need it to display a ERROR at the bottom where it sums if any cell contains text.

    Any ideas

    Thanks

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: How to produce error if text is included in a sum

    Hi, welcome to the forum

    probably a simpler way of doing this, but try...
    =IF(COUNT(J1:J4)=COUNTA(J1:J4),SUM(J1:J4),#VALUE!)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: How to produce error if text is included in a sum

    This is an alternative (no simpler!!):

    =IF(ISERROR(SUMPRODUCT((A1:A4)*ROW(A1:A4))),"Error",SUM(A1:A4))
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  4. #4
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,909

    Re: How to produce error if text is included in a sum

    Or:

    =IF(SUMPRODUCT(--ISTEXT(A1:A4)),"#VALIE",SUM(A1:A4))

  5. #5
    Forum Contributor
    Join Date
    10-30-2003
    Location
    Singapore
    MS-Off Ver
    Excel 2019
    Posts
    197

    Re: How to produce error if text is included in a sum

    Or,

    =SUMPRODUCT(--A1:A4)

    Regards
    Bosco

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: How to produce error if text is included in a sum

    Yes.... I forgot about the --. Neat!

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: How to produce error if text is included in a sum

    See? Told you there would be a simpler way, nicely done Bosco

+ 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. How to produce a merget text output of randomly chosen text values
    By SORENAA in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-16-2013, 04:53 PM
  2. VLOOKUP, #NA error, pic included, any ideas on how to fix this?
    By Geoffo123 in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 11-21-2012, 07:04 PM
  3. Replies: 2
    Last Post: 02-11-2010, 02:37 PM
  4. Getting rid of #num error when blank cell included in formula
    By moorelm in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-16-2009, 05:55 PM
  5. Automation macro produce error when copy and paste
    By Klam in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-15-2007, 06:14 AM
  6. Why does this produce an error?
    By zaphod2003 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-12-2006, 05:22 AM
  7. produce a formulate to produce assigned seats for dinner
    By DavidJoss in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 10-03-2005, 10:05 PM
  8. [SOLVED] Run-time error '9' ---- Code to fix included.
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-02-2005, 10:05 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