+ Reply to Thread
Results 1 to 14 of 14

#VALUE showing when a cell is bank, but the function works perfectly when data is present

  1. #1
    Registered User
    Join Date
    08-10-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    20

    #VALUE showing when a cell is bank, but the function works perfectly when data is present

    I've attached the workbook to show what the issue is along with my formula used. How can I stop #VALUE from showing up in blank cells? It's very odd to me that the formula works perfectly when there's data there, but when it's blank #VALUE shows.

    The reason it matters is because it is corrupting the SUM function at the top of my worksheet.

    Here is the formula:

    =IF(G5="","",IFERROR(CHOOSE(LEN(G5)-LEN(SUBSTITUTE(G5,"*","")),14,16,18,20,22),IF(LEN(G5)-LEN(SUBSTITUTE(G5,"!",""))=1,20,IF(LEN(G5)-LEN(SUBSTITUTE(G5,"@",""))=1,5,IF(LEN(G5)-LEN(SUBSTITUTE(G5,"#",""))=1,5,IF(LEN(G5)-LEN(SUBSTITUTE(G5,"%",""))=1,18,IF(LEN(G5)-LEN(SUBSTITUTE(G5,"%",""))=2,24,12)))))))+IF(LEFT(G5)="&",4,0)
    Attached Files Attached Files
    Last edited by Nexion21; 09-06-2013 at 05:18 PM.

  2. #2
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: #VALUE showing when a cell is bank, but the function works perfectly when data is pres

    does this help

    Please Login or Register  to view this content.
    Ernest

    Please consider adding a * if I helped

    Nothing drives me crazy - I'm always close enough to walk....

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

    Re: #VALUE showing when a cell is bank, but the function works perfectly when data is pres

    You need to reposition one of the closed brackets, like this:

    =IF(D5="","",IFERROR(CHOOSE(LEN(D5)-LEN(SUBSTITUTE(D5,"*","")),14,16,18,20,22),IF(LEN(D5)-LEN(SUBSTITUTE(D5,"!",""))=1,20,IF(LEN(D5)-LEN(SUBSTITUTE(D5,"@",""))=1,5,IF(LEN(D5)-LEN(SUBSTITUTE(D5,"#",""))=1,5,IF(LEN(D5)-LEN(SUBSTITUTE(D5,"%",""))=1,18,IF(LEN(D5)-LEN(SUBSTITUTE(D5,"%",""))=2,24,12))))))+IF(LEFT(D5)="&",4,0))

    so the final 4 or zero will only be added on if D5 is not empty.

    Hope this helps.

    Pete

  4. #4
    Registered User
    Join Date
    08-10-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: #VALUE showing when a cell is bank, but the function works perfectly when data is pres

    It works! Thank you Judgeh59!

  5. #5
    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,939

    Re: #VALUE showing when a cell is bank, but the function works perfectly when data is pres

    It looks like you closed your IF() statement too soon...
    =IF(D5="","",IFERROR(CHOOSE(LEN(D5)-LEN(SUBSTITUTE(D5,"*","")),14,16,18,20,22),IF(LEN(D5)-LEN(SUBSTITUTE(D5,"!",""))=1,20,IF(LEN(D5)-LEN(SUBSTITUTE(D5,"@",""))=1,5,IF(LEN(D5)-LEN(SUBSTITUTE(D5,"#",""))=1,5,IF(LEN(D5)-LEN(SUBSTITUTE(D5,"%",""))=1,18,IF(LEN(D5)-LEN(SUBSTITUTE(D5,"%",""))=2,24,12)))))))+IF(LEFT(D5)="&",4,0)
    change to this...
    =IF(D5="","",IFERROR(CHOOSE(LEN(D5)-LEN(SUBSTITUTE(D5,"*","")),14,16,18,20,22),IF(LEN(D5)-LEN(SUBSTITUTE(D5,"!",""))=1,20,IF(LEN(D5)-LEN(SUBSTITUTE(D5,"@",""))=1,5,IF(LEN(D5)-LEN(SUBSTITUTE(D5,"#",""))=1,5,IF(LEN(D5)-LEN(SUBSTITUTE(D5,"%",""))=1,18,IF(LEN(D5)-LEN(SUBSTITUTE(D5,"%",""))=2,24,12))))))+IF(LEFT(D5)="&",4,0))

    Also, underneath that formula you just have a bunch of #Value formulas

    edit: Pete beat me to it
    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

  6. #6
    Registered User
    Join Date
    08-10-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: #VALUE showing when a cell is bank, but the function works perfectly when data is pres

    Thanks! I didn't realize that I closed that too early. The workbook I uploaded was a test document, so yeah the #VALUE under the formulas I wasn't really paying attention to. Everything is fixed now!

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

    Re: #VALUE showing when a cell is bank, but the function works perfectly when data is pres

    I just went through Evaluate Formula, and then it was obvious what the problem was.

    Pete

  8. #8
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: #VALUE showing when a cell is bank, but the function works perfectly when data is pres

    glad we could all help....

    @Pete.....I do like the Evaluate Formula....except on array formulas.....

  9. #9
    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,939

    Re: #VALUE showing when a cell is bank, but the function works perfectly when data is pres

    Thats pretty much what I did too, Pete - very powerful tool

  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: #VALUE showing when a cell is bank, but the function works perfectly when data is pres

    Quote Originally Posted by judgeh59 View Post

    @Pete.....I do like the Evaluate Formula....except on array formulas.....
    Certain types of array formulas will cause Excel 2003 and earlier versions to crash when using Evaluate Formula.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

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

    Re: #VALUE showing when a cell is bank, but the function works perfectly when data is pres

    I used XL2000 for many years and then did the jump to XL2007 - Evaluate Formula wasn't included in XL2000 so it was a welcome bonus when I upgraded.

    Pete

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

    Re: #VALUE showing when a cell is bank, but the function works perfectly when data is pres

    It was introduced in Excel 2002.

    A lot of what I know I learned by dissecting formulas using Evaluate Formula.

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

    Re: #VALUE showing when a cell is bank, but the function works perfectly when data is pres

    Ah, maybe I should have upgraded earlier, then I might be as good as you, Biff <bg>

    Pete

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

    Re: #VALUE showing when a cell is bank, but the function works perfectly when data is pres

    Be careful about what you wish for!

+ 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. Array Formula works perfectly in Excel 2007 but don't work in GDoc
    By lati2008 in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 5
    Last Post: 08-27-2013, 07:51 AM
  2. [SOLVED] Excel 2010 Macro not working on Windows 7 but same works perfectly on XP
    By rahulwagh in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-01-2013, 02:14 PM
  3. Works perfectly in Excel 2010 but Fails in 2003
    By markharris2004 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-06-2013, 01:20 PM
  4. Macro works and loops perfectly in VBA but does not loop on button click
    By evan.sams in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-25-2012, 08:25 PM
  5. [SOLVED] Can not work with macros in Excel... But works perfectly in Word
    By Oban in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-23-2012, 06:16 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