+ Reply to Thread
Results 1 to 11 of 11

If then statement. Want the result to display the number in another cell.

  1. #1
    Registered User
    Join Date
    01-05-2013
    Location
    Brandon Florida
    MS-Off Ver
    Excel 2003
    Posts
    3

    If then statement. Want the result to display the number in another cell.

    Hey Folks just a quick IF THEN statement question. Below is my current statement and please let me know what should be fixed.

    =IF(V17>0,"V17+0","0") Basically i have a new column W... in W i want the box to display what is in V if its greater then 0. AKA positive gains... if the gains are 0 or negative i want it to display 0... well it displays the 0 correclty but it displays V17 instead of the number thats in cell V17, how would i fix that? let me know

    THanks all

  2. #2
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: If then statement. Want the result to display the number in another cell.

    remove the quotes and the +0 too..
    Please Login or Register  to view this content.
    or simply
    Please Login or Register  to view this content.
    Life's a spreadsheet, Excel!
    Say thanks, Click *

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

    Re: If then statement. Want the result to display the number in another cell.

    Just remove all the quotes - they are only needed if you want to return text values.

    =IF(V17>0,V17,0)

    Or, you could use this instead:

    =MAX(V17,0)

    Hope this helps.

    Pete

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

    Re: If then statement. Want the result to display the number in another cell.

    remove the quotes ""
    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

  5. #5
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: If then statement. Want the result to display the number in another cell.

    Try removing the quotes.
    Martin

  6. #6
    Registered User
    Join Date
    01-05-2013
    Location
    Brandon Florida
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: If then statement. Want the result to display the number in another cell.

    Thanks a bunch. What does the MAX action do

  7. #7
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: If then statement. Want the result to display the number in another cell.

    MAX function returns maximum of the values listed, hence it will return zero if V17 is negative (zero being the MAX of tthe two values). If V17 is positive it will return V17 for the same reason.

    read here too..
    http://www.techonthenet.com/excel/formulas/max.php

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

    Re: If then statement. Want the result to display the number in another cell.

    It returns the larger of the 2 values. So if V17 is greater than 0 then the MAX function will return V17. If it drops below zero then it will return zero instead - same as your IF function.

    Hope this helps.

    Pete

  9. #9
    Registered User
    Join Date
    01-05-2013
    Location
    Brandon Florida
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: If then statement. Want the result to display the number in another cell.

    Perfect.. Thanks all. Worked like a charm

  10. #10
    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,929

    Re: If then statement. Want the result to display the number in another cell.

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

    Also, as a relatively new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

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

    Re: If then statement. Want the result to display the number in another cell.

    Here's another one...

    =(V17>0)*V17
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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