+ Reply to Thread
Results 1 to 8 of 8

If this, show this

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

    If this, show this

    A B
    1 1A
    2 1B
    3 2A
    4 2B
    5 2A

    from table, I want result like this
    eg:
    If C1=1, D1 show 1A
    If C1=3, D1 show 2A

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

    Re: If this, show this

    Maybe this?

    =IF(C1=1,1A,IF(C1=3,2A,""))

    Although I have a feeling your actual situation is more complex that this. Can you share exactlt what you are trying to do?
    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 Contributor
    Join Date
    03-06-2014
    Location
    malaysia
    MS-Off Ver
    Excel 2003/2010/2013
    Posts
    107

    Re: If this, show this

    What if, C1=4?

    this is the problem from previous thread which getting no solution, thus i try another option...

    Quote Originally Posted by FDibbins View Post
    Maybe this?

    =IF(C1=1,1A,IF(C1=3,2A,""))

    Although I have a feeling your actual situation is more complex that this. Can you share exactlt what you are trying to do?

    How about his formula? can u help me how to fix bold part so that formula read input from B column?

    =IF(C1>=1,"get result from B1:B5",IF(C1 = 0, "Not Found"))
    Last edited by amein; 09-04-2015 at 10:43 PM.

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

    Re: If this, show this

    Your question was...
    If C1=1, D1 show 1A
    If C1=3, D1 show 2A
    Thats what I answered. I also said
    Although I have a feeling your actual situation is more complex that this. Can you share exactlt what you are trying to do?
    So, save us both some time, and tell me exactly what you are trying to do

    (ald also, please take note of teh forum rules regarding posting duplicate threads)

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

    Re: If this, show this

    Attach excel. Sorry..

    7KkPGvT.png

    Desired result

    E3=1, C4=1A
    E3=2, C4=1B
    E3=3, C4=2A
    E3=4, C4=2B
    E3=5, C4=3A
    and so on


    Quote Originally Posted by FDibbins View Post
    Your question was...


    Thats what I answered. I also said


    So, save us both some time, and tell me exactly what you are trying to do

    (ald also, please take note of teh forum rules regarding posting duplicate threads)
    Attached Files Attached Files

  6. #6
    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,946

    Re: If this, show this

    Still a bit confusing as to what you are trying to do there, but perhaps this?

    make up a small table with your values and your results...
    I
    J
    8
    1
    1A
    9
    2
    1B
    10
    3
    2A
    11
    4
    2B
    12
    5
    3A


    Then use this to find what you want...
    =VLOOKUP($E$3,I8:J12,2,0)

    Note though, that the "2" in E3 is actually text, not a value. Any time you concat numbers, the result is text. To overcome that, change the formula in E2 to this...
    =--IF(SUMPRODUCT(--(B6:B15<=C3)*(C6:C15>=C3))=1,""&SUMPRODUCT(--(B6:B15<=C3)*(C6:C15>=C3),ROW(D6:D15)-5),"Not Found")
    Note the -- after =

    That formula actually doesnt really make sense though, because 1 text will never be >= another text, it will only ever be = or not =. exactly what are you trying to achieve there?

    Also, you have a circular reference error in C4. the formula you have there is referencing itself...
    C4=IF(SUMPRODUCT(--(B6:B15<=C3)*(C6:C15>=C3))=1,"Row no. "&INDEX(D6:D15,C4),"Not Found")

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

    Re: If this, show this

    Thank you for your help FDibbins.

    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


    Quote Originally Posted by FDibbins View Post
    Still a bit confusing as to what you are trying to do there, but perhaps this?

    make up a small table with your values and your results...
    I
    J
    8
    1
    1A
    9
    2
    1B
    10
    3
    2A
    11
    4
    2B
    12
    5
    3A


    Then use this to find what you want...
    =VLOOKUP($E$3,I8:J12,2,0)

    Note though, that the "2" in E3 is actually text, not a value. Any time you concat numbers, the result is text. To overcome that, change the formula in E2 to this...
    =--IF(SUMPRODUCT(--(B6:B15<=C3)*(C6:C15>=C3))=1,""&SUMPRODUCT(--(B6:B15<=C3)*(C6:C15>=C3),ROW(D6:D15)-5),"Not Found")
    Note the -- after =

    That formula actually doesnt really make sense though, because 1 text will never be >= another text, it will only ever be = or not =. exactly what are you trying to achieve there?

    Also, you have a circular reference error in C4. the formula you have there is referencing itself...
    C4=IF(SUMPRODUCT(--(B6:B15<=C3)*(C6:C15>=C3))=1,"Row no. "&INDEX(D6:D15,C4),"Not Found")
    Last edited by amein; 09-05-2015 at 01:45 AM.

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

    Re: If this, show this

    Improve excel file after done correction with @FDibbins help
    Attached Files Attached Files

+ 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. Replies: 2
    Last Post: 08-14-2014, 06:03 AM
  2. [SOLVED] One TextBox Show Column and the other show Cell address Solved by : ragulduy
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-26-2014, 05:17 AM
  3. Replies: 2
    Last Post: 02-24-2014, 08:20 PM
  4. [SOLVED] how to add counter in msgbox to show remain times the message will show vba code
    By sspreyer in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-25-2013, 06:46 AM
  5. Replies: 0
    Last Post: 06-15-2011, 10:36 AM
  6. Replies: 1
    Last Post: 04-11-2008, 02:02 AM
  7. Replies: 1
    Last Post: 12-19-2005, 04:25 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