+ Reply to Thread
Results 1 to 13 of 13

IF Formula - Populate a cell only when another cell is filled

  1. #1
    Registered User
    Join Date
    05-24-2020
    Location
    London
    MS-Off Ver
    2016
    Posts
    76

    Question IF Formula - Populate a cell only when another cell is filled

    Hi, I have attached an excel doc.

    Would be grateful with a little help with 2 formulas.
    In the table under the Points+/- header (column F) and Profit +/- (column H)
    how do I get the cells to only show data when the Closing Price (column J) has been filled?

    To recap, I would like the cells to remain blank when the Status (column E) says Closed and only have columns F & J populate
    when column J is filled.

    Help would be very much appreciated, thanks.

  2. #2
    Registered User
    Join Date
    05-24-2020
    Location
    London
    MS-Off Ver
    2016
    Posts
    76

    Re: IF Formula - Populate a cell only when another cell is filled

    Here is the excel worksheet
    Attached Files Attached Files

  3. #3
    Valued Forum Contributor
    Join Date
    03-24-2020
    Location
    Thailand
    MS-Off Ver
    Office 2016
    Posts
    845

    Re: IF Formula - Populate a cell only when another cell is filled

    Hi kgtrader,
    You can wrap your formula into an IF statement. Below is the sample for column F:

    =IF([@[Closing Price]]<>"",IFERROR(IF(LEFT([@Status],3)="Ope"," N/A - Open Trade",IF([@[Long/Short]]="Short",[@[Entry Price]]-[@[Closing Price]],[@[Closing Price]]-[@[Entry Price]])),"Error Check Column"),"")

    If it works for you, wrap the second formula into the same if statement.

  4. #4
    Registered User
    Join Date
    05-24-2020
    Location
    London
    MS-Off Ver
    2016
    Posts
    76

    Re: IF Formula - Populate a cell only when another cell is filled

    Hi ORoos, thanks for sending this.
    But would you be able to have the 'Points+/-' and 'Profits +/-' still show 'N/A - Open Trade' if the Status has 'Open' or 'Position Risk-Free' showing?
    At the moment the 'Points+/-' and 'Profits +/-' remains blank until 'Closing Price' has been filled with data.

    So basically the logic is that when 'Open' or 'Position Risk-Free' is showing status there will be no need to have a closing price, therefore
    'Points+/-' and 'Profits +/-' should say 'N/A - Open Trade'
    Once anything else is selected in the 'Status' dropdown' beginning with Trade Closed, then I would like the 'Points+/-' and 'Profits +/-'
    to become blank and populate only when 'Closing Price' has been filled.

    Hope that makes sense. :-)

  5. #5
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,803

    Re: IF Formula - Populate a cell only when another cell is filled

    It's a little confusing, but I think you can try this under "Points+/-"

    =IFERROR(IF(OR([@Status]="Open",[@Status]="Trade Open - Risk-Free"),"N/A - Open Trade",IF([@[Closing Price]]="","",IF([@[Long/Short]]="Short",[@[Entry Price]]-[@[Closing Price]],[@[Closing Price]]-[@[Entry Price]]))),"Error Check Column")

  6. #6
    Registered User
    Join Date
    05-24-2020
    Location
    London
    MS-Off Ver
    2016
    Posts
    76

    Re: IF Formula - Populate a cell only when another cell is filled

    That worked @Gregb11 thanks.
    How do I input that into Profit +/- correctly.
    Look forward to hearing back.

  7. #7
    Registered User
    Join Date
    05-24-2020
    Location
    London
    MS-Off Ver
    2016
    Posts
    76

    Re: IF Formula - Populate a cell only when another cell is filled

    Hi can anyone help with with the above issue?

    Thanks

  8. #8
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,803

    Re: IF Formula - Populate a cell only when another cell is filled

    I didn't know how much of your current formula you wanted to keep, but you can try this in H3 and see if it does what you want. If not, please let us know what condition is not working.

    =IFERROR(IF(OR([@Status]="Open",[@Status]="Trade Open - Risk-Free"),"N/A - Open Trade",IF([@[Closing Price]]="","",IF(OR([@Status]="",[@Status]=" - ")," - ",IF(LEFT([@Status],12)="Trade Closed",SUM([@[Points+/-]]*[@[Value Per Pip/Point]],[@[Mics Adjustment]]),"N/A - Check Row Inputs")))),"")

  9. #9
    Registered User
    Join Date
    05-24-2020
    Location
    London
    MS-Off Ver
    2016
    Posts
    76

    Re: IF Formula - Populate a cell only when another cell is filled

    Hi Gregb11 it is saying that the syntax of the name isn't correct when I add the formula you just sent.

  10. #10
    Registered User
    Join Date
    05-24-2020
    Location
    London
    MS-Off Ver
    2016
    Posts
    76

    Re: IF Formula - Populate a cell only when another cell is filled

    Gregb11, ignore my last message as I could input the formula.
    The only thing is that when the Profit +/- should show an amount once the other cells are filled, it is just saying N/A - Check Row Inputs

  11. #11
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,803

    Re: IF Formula - Populate a cell only when another cell is filled

    Can you give a specific example or upload the file that shows the scenario? It's only showing "N/A - Check Row Inputs" when Status = "Open" or "Trade Open - Risk Free". I've upload my file.
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    05-24-2020
    Location
    London
    MS-Off Ver
    2016
    Posts
    76

    Re: IF Formula - Populate a cell only when another cell is filled

    Gregb11 sorry I did something wrong and your formula works fine.
    Thanks a lot for your help with this.

    Much appreciated

  13. #13
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    79,368

    Re: IF Formula - Populate a cell only when another cell is filled

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

+ 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: 02-10-2017, 05:29 AM
  2. How to start a timer whenever a cell is filled, stops whenever another cell is filled
    By PerplexedEngineer in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-23-2016, 11:58 AM
  3. [SOLVED] Formula: If cell 3 is blank have cell 1 calculate, if cell 3 filled have cell 2 calculate
    By Vicious00013 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 04-05-2016, 09:34 AM
  4. Formula to run only when a cell is filled
    By Ziggy21 in forum Excel General
    Replies: 3
    Last Post: 02-25-2015, 11:14 AM
  5. Count filled and empty cells from the first filled cell in a row
    By mdaoust in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-01-2014, 01:23 PM
  6. Replies: 12
    Last Post: 07-10-2012, 05:04 PM
  7. Need formula for last cell filled in on a row
    By Calculation of Text in forum Excel General
    Replies: 2
    Last Post: 04-26-2006, 08:30 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