+ Reply to Thread
Results 1 to 11 of 11

How to treat specific text as zero in a formula for finding LARGE numbers from cells

  1. #1
    Registered User
    Join Date
    05-25-2016
    Location
    Dhaka, Bangladesh
    MS-Off Ver
    2010
    Posts
    31

    Question How to treat specific text as zero in a formula for finding LARGE numbers from cells

    Hi all !

    I have a workbook where cells D12:H12 contain exam marks of students. I use a formula in cell I12 to sum the best 4 marks from cells D12:H12. But the problem arises when students were absent in exams and their marks for that exams are shown as *Absent* in the cells.

    How can I treat the text *Absent* as 0 (zero marks) in the formula used in cell I12?

    Thanks in advance.

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: How to treat specific text as zero in a formula for finding LARGE numbers from cells

    This will sum the 4 largest numbers in the range:

    =SUM(LARGE(D12:H12,{1,2,3,4}))

    Assumes there will be at least 4 numbers to sum.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: How to treat specific text as zero in a formula for finding LARGE numbers from cells

    This array entered** version will account for when there are <4 numbers:

    =SUM(IFERROR(LARGE(D12:H12,{1,2,3,4}),0))

    If there are less than 4 numbers it will sum however many numbers are available.

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

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

    Re: How to treat specific text as zero in a formula for finding LARGE numbers from cells

    As you only have 5 marks:

    =SUM(D12:H12)-IF(COUNT(D12:H12)=5,MIN(D12:H12),0)

    This ignores text and subtracts the MINIMUM value only if there are 5 marks

  5. #5
    Registered User
    Join Date
    05-25-2016
    Location
    Dhaka, Bangladesh
    MS-Off Ver
    2010
    Posts
    31

    Re: How to treat specific text as zero in a formula for finding LARGE numbers from cells

    Quote Originally Posted by Tony Valko View Post
    This will sum the 4 largest numbers in the range:

    =SUM(LARGE(D12:H12,{1,2,3,4}))

    Assumes there will be at least 4 numbers to sum.
    Thanks Tony !
    But I'm facing problem when a student has 2 or more *Absent* value as marks in cells D12:H12.
    How can I treat the text *Absent* as 0 (zero marks) in the formula used in cell I12?

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: How to treat specific text as zero in a formula for finding LARGE numbers from cells

    See post #3

  7. #7
    Forum Contributor
    Join Date
    04-12-2013
    Location
    Usually at work, in the UK
    MS-Off Ver
    Excel 2010
    Posts
    639

    Re: How to treat specific text as zero in a formula for finding LARGE numbers from cells

    Can 't you create a column and add the marks into the column and anywhere there is an absent insert 0?

  8. #8
    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
    28,206

    Re: How to treat specific text as zero in a formula for finding LARGE numbers from cells

    Both formulas treat absent as 0 as SUM ignores text values (effectively zero).

  9. #9
    Registered User
    Join Date
    05-25-2016
    Location
    Dhaka, Bangladesh
    MS-Off Ver
    2010
    Posts
    31

    Re: How to treat specific text as zero in a formula for finding LARGE numbers from cells

    Quote Originally Posted by Tony Valko View Post
    This array entered** version will account for when there are <4 numbers:

    =SUM(IFERROR(LARGE(D12:H12,{1,2,3,4}),0))

    If there are less than 4 numbers it will sum however many numbers are available.

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.
    Thanks a lot Tony
    It works great now.

  10. #10
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: How to treat specific text as zero in a formula for finding LARGE numbers from cells

    You're welcome. Thanks for the feedback!

  11. #11
    Registered User
    Join Date
    05-25-2016
    Location
    Dhaka, Bangladesh
    MS-Off Ver
    2010
    Posts
    31

    Re: How to treat specific text as zero in a formula for finding LARGE numbers from cells

    Quote Originally Posted by JohnTopley View Post
    As you only have 5 marks:

    =SUM(D12:H12)-IF(COUNT(D12:H12)=5,MIN(D12:H12),0)

    This ignores text and subtracts the MINIMUM value only if there are 5 marks
    Thanks John !
    Your formula works successfully also

+ 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. Formula for finding a specific sum from a range of numbers?
    By jdawg1536 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-18-2014, 04:19 AM
  2. Excel XP: Treat specific text as zero.
    By bigjayb024 in forum Excel General
    Replies: 5
    Last Post: 09-10-2014, 05:31 AM
  3. How to treat specific text as numerical value
    By HavokJak in forum Excel General
    Replies: 2
    Last Post: 05-17-2014, 11:23 PM
  4. [SOLVED] Treat numbers as text
    By stealf in forum Excel General
    Replies: 2
    Last Post: 10-03-2012, 06:05 AM
  5. I want to treat numbers as text without any complaints
    By Stol in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-01-2006, 03:55 PM
  6. CONDITIONAL FORMATING FINDING TEXT CONTAINING SPECIFIC NUMBERS
    By Twiggy in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-12-2006, 04:20 AM
  7. force Excel to treat numbers as text
    By GottaRun in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 03-18-2006, 06:15 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