+ Reply to Thread
Results 1 to 19 of 19

Help me fixing my excel formula...

  1. #1
    Forum Contributor
    Join Date
    03-06-2014
    Location
    malaysia
    MS-Off Ver
    Excel 2003/2010/2013
    Posts
    107

    Question Help me fixing my excel formula...

    Hi guys, as per title i need help regarding my formula. Attached excel file...

    1. Input "HD50" until "HD5000" giving error "#VALUE!". Why is that happen, some others input all working fine..

    for example:

    A100 will show result 1A
    HB300 will show 2A

    Edit: Im sorry attaching wrong file...

    More info on project:

    Actually this project related to the library books call number. I want to create something so that user will easier search books belong to which shelf.

    Column B and C is the Call Number (book reference number) and Column D represent Shelf Label.

    Those inside excel only few database, i have alot more.. I know got some error... I'll try fix that later on..

    1 shelf in the library have 2 side (1A and 1B), figure below..each side we label using call number (eg: G154 - HB171.5)

    sNRPek7.jpg

    So, let say user want to search book call number HB100, then they just input HB100, result will show this book shelve in which shelf.

    Xn8xeF7.png

    More sample INPUT vs RESULT
    y873gvs.png

    UPDATE: EXPECTED FINAL RESULT

    Something like this, with other data cell will be hide and lock

    ZMHlTtR.png
    Attached Files Attached Files
    Last edited by amein; 09-07-2015 at 09:30 PM.

  2. #2
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Help me fixing my excel formula...

    Hi.

    I don't understand your formula in F6, in particular why you are first concatenating "" and then applying -- to the result of the SUMPRODUCT. The first renders the numeric result of that function as text, the second then takes this text number and converts it back to a numeric. But why? Isn't performing these two opposite operations equivalent to performing neither?

    And this explains your #VALUE! error: if the result of the IF clause is FALSE, then you have:

    =--"Not Found"

    and of course this results in an error, since you are attempting to perform a mathematical operation on a text string.

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  3. #3
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Help me fixing my excel formula...

    You don't need the helpcell if you use this formula.

    c4 =INDEX($B$6:$D$18,match($C$3,$C$6:$C$18,0),3)

    HD50" until "HD5000" giving an error since they are not found in the data in column C.

    You ask for an exact match (you use 0) and therefore the data is not found.

    (1 is the other option => not exact match).
    Last edited by oeldere; 09-07-2015 at 02:55 AM. Reason: changed ; into ,
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  4. #4
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,613

    Re: Help me fixing my excel formula...

    because in row 10 you have:
    HD30.29 HD58.6
    and then again in row 13:
    HD4901 HF5415

    So in your formula in cell F6 function SUMPRODUCT returns 2 for input like HD4901, HD50, HD5000 and so on.

    And then the formula takes third argument of IF and returns
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    which is obviously error.
    Best Regards,

    Kaper

  5. #5
    Forum Contributor
    Join Date
    03-06-2014
    Location
    malaysia
    MS-Off Ver
    Excel 2003/2010/2013
    Posts
    107

    Re: Help me fixing my excel formula...

    Quote Originally Posted by XOR LX View Post
    Hi.

    I don't understand your formula in F6, in particular why you are first concatenating "" and then applying -- to the result of the SUMPRODUCT. The first renders the numeric result of that function as text, the second then takes this text number and converts it back to a numeric. But why? Isn't performing these two opposite operations equivalent to performing neither?

    And this explains your #VALUE! error: if the result of the IF clause is FALSE, then you have:

    =--"Not Found"

    and of course this results in an error, since you are attempting to perform a mathematical operation on a text string.

    Regards
    Thats best way i can come out for desired result.. still new learning excel.. F6 serve as reference cell..

  6. #6
    Forum Contributor
    Join Date
    03-06-2014
    Location
    malaysia
    MS-Off Ver
    Excel 2003/2010/2013
    Posts
    107

    Re: Help me fixing my excel formula...

    Thank you, i'll give a try

    Quote Originally Posted by oeldere View Post
    You don't need the helpcell if you use this formula.

    c4 =INDEX($B$6:$D$18,match($C$3,$C$6:$C$18,0),3)

    HD50" until "HD5000" giving an error since they are not found in the data in column C.

    You ask for an exact match (you use 0) and therefore the data is not found.

    (1 is the other option => not exact match).

  7. #7
    Forum Contributor
    Join Date
    03-06-2014
    Location
    malaysia
    MS-Off Ver
    Excel 2003/2010/2013
    Posts
    107

    Re: Help me fixing my excel formula...

    Is there any way so that i can show error "not found" instead #VALUE! ?

    Quote Originally Posted by Kaper View Post
    because in row 10 you have:
    HD30.29 HD58.6
    and then again in row 13:
    HD4901 HF5415

    So in your formula in cell F6 function SUMPRODUCT returns 2 for input like HD4901, HD50, HD5000 and so on.

    And then the formula takes third argument of IF and returns
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    which is obviously error.

  8. #8
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Help me fixing my excel formula...

    for excel 2007 and further you can use iferror(your fomula,"not found")

    for your excel 2003 version this will not work.

  9. #9
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Help me fixing my excel formula...

    As per my suggestions, remove the "" and -- and just use:

    =IF(SUMPRODUCT(--(B6:B162<=C3)*(C6:C162>=C3))=1,SUMPRODUCT(--(B6:B162<=C3)*(C6:C162>=C3),ROW(B6:B162)-5),"Not Found")

    Regards

  10. #10
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,613

    Re: Help me fixing my excel formula...

    But ... have you noticed my comment:
    because in row 10 you have:
    HD30.29 HD58.6
    and then again in row 13:
    HD4901 HF5415
    With such data there be "Not found" for the code which is appropriate for both shelfs

    to find only one you coud for instance use array formula*:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    *)...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.

  11. #11
    Forum Contributor
    Join Date
    03-06-2014
    Location
    malaysia
    MS-Off Ver
    Excel 2003/2010/2013
    Posts
    107

    Re: Help me fixing my excel formula...

    Hi, i tried few input, cant get them all correct

    Z8MbAOE.png

    IAssLhQ.png

    W8TuUS4.png

  12. #12
    Forum Contributor
    Join Date
    03-06-2014
    Location
    malaysia
    MS-Off Ver
    Excel 2003/2010/2013
    Posts
    107

    Re: Help me fixing my excel formula...

    hi, what do you mean by "not found"

    HD30.29 HD58.6

    HD50, not fall between this two?

    btw, HkWON3d.png


    Quote Originally Posted by oeldere View Post
    You don't need the helpcell if you use this formula.

    c4 =INDEX($B$6:$D$18,match($C$3,$C$6:$C$18,0),3)

    HD50" until "HD5000" giving an error since they are not found in the data in column C.

    You ask for an exact match (you use 0) and therefore the data is not found.

    (1 is the other option => not exact match).

  13. #13
    Forum Contributor
    Join Date
    03-06-2014
    Location
    malaysia
    MS-Off Ver
    Excel 2003/2010/2013
    Posts
    107

    Re: Help me fixing my excel formula...

    Quote Originally Posted by XOR LX View Post
    As per my suggestions, remove the "" and -- and just use:

    =IF(SUMPRODUCT(--(B6:B162<=C3)*(C6:C162>=C3))=1,SUMPRODUCT(--(B6:B162<=C3)*(C6:C162>=C3),ROW(B6:B162)-5),"Not Found")

    Regards
    Hi, thank you thats fixed #value error..

    btw. any idea why HD50 cannot be found while HD48, HD49 can..

  14. #14
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Help me fixing my excel formula...

    Quote Originally Posted by amein View Post
    btw. any idea why HD50 cannot be found while HD48, HD49 can..
    Because your formula is not a very good one. The reason that, for example, HD50 results in "Not Found" is that your formula is asking to return values only when this part:

    SUMPRODUCT(--(B6:B162<=C3)*(C6:C162>=C3))

    is equal to 1.

    However, for HD50, this part is equal to 2, not 1, since there are 2 rows in your data for which this statement is satisfied, rows 10 and 13, i.e.:

    HD30.29|HD58.6

    and:

    HD4901|HF5415

    This is because, for the first pair, HD30.29 is <= HD50 and HD58.6 is >= HD50.

    And, also, for the second pair, HD4901 is <= HD50 and HF5415 is >= HD50.

    I don't understand what you are trying to do in this sheet. Perhaps you can explain?

    Regards

  15. #15
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,613

    Re: Help me fixing my excel formula...

    Nope!
    With my formula HD50 is located!
    See my previous 2 posts, you probably missed them.
    The real problem is with your data. And you probably know GIGO rule ...
    Attached Images Attached Images

  16. #16
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,613

    Re: Help me fixing my excel formula...

    And the file for reference if you face problems with array formula
    Attached Files Attached Files

  17. #17
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Help me fixing my excel formula...

    @amein

    It is always good to ad to who you are replying.

    Replyin to #12

    I can't read the PNG, so that give me no information.

    If you don't want an exact match, but the lower one, you need to use 1 instead of 1

    Try the formula below, and please reply the result.

    c4 =INDEX($B$6:$D$18,match($C$3,$C$6:$C$18,1),3)

  18. #18
    Forum Contributor
    Join Date
    03-06-2014
    Location
    malaysia
    MS-Off Ver
    Excel 2003/2010/2013
    Posts
    107

    Re: Help me fixing my excel formula...

    Quote Originally Posted by XOR LX View Post
    Because your formula is not a very good one. The reason that, for example, HD50 results in "Not Found" is that your formula is asking to return values only when this part:

    SUMPRODUCT(--(B6:B162<=C3)*(C6:C162>=C3))

    is equal to 1.

    However, for HD50, this part is equal to 2, not 1, since there are 2 rows in your data for which this statement is satisfied, rows 10 and 13, i.e.:

    HD30.29|HD58.6

    and:

    HD4901|HF5415

    This is because, for the first pair, HD30.29 is <= HD50 and HD58.6 is >= HD50.

    And, also, for the second pair, HD4901 is <= HD50 and HF5415 is >= HD50.

    I don't understand what you are trying to do in this sheet. Perhaps you can explain?

    Regards
    Yes, this is why i open this thread. Im still learning this..

    Already add more info on first post.

    Expected something like below with some interface touchup and other data cell will be hide...
    ZMHlTtR.png

  19. #19
    Forum Contributor
    Join Date
    03-06-2014
    Location
    malaysia
    MS-Off Ver
    Excel 2003/2010/2013
    Posts
    107

    Re: Help me fixing my excel formula...

    Quote Originally Posted by Kaper View Post
    And the file for reference if you face problems with array formula
    Thank you Kaper for many help.. I think this problem already solved with your corrections...

    thanks again.
    Last edited by amein; 09-07-2015 at 09:47 PM.

+ 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] Help Fixing A Formula
    By artiststevens in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-21-2015, 03:12 AM
  2. [SOLVED] Need help in fixing my formula
    By rojashan in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-04-2014, 12:08 AM
  3. [SOLVED] Need Help Fixing A Nested Formula
    By artiststevens in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-27-2013, 05:29 AM
  4. Fixing a Formula
    By Uvuriel03 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-21-2013, 08:43 AM
  5. Help Fixing IF/AND Formula
    By artiststevens in forum Excel General
    Replies: 22
    Last Post: 03-02-2012, 06:14 PM
  6. fixing a date formula
    By NYBoy in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 07-13-2008, 07:54 PM
  7. Fixing a formula
    By Boethius1 in forum Excel General
    Replies: 2
    Last Post: 01-18-2006, 07:38 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