+ Reply to Thread
Results 1 to 7 of 7

If Statement Help

  1. #1
    Forum Contributor
    Join Date
    06-16-2014
    Location
    Columbia, Maryland
    MS-Off Ver
    2013
    Posts
    134

    If Statement Help

    Ok so I have 8 years of year-over-year growth in Free Cash Flow per share for a company and it's sector as a whole. In the attachment cell S6 is supposed to count up the # of times the companies growth rate was better than it's respective sector and score a 1 if it was true and 0 if not. The problem I'm running into is that if a company had no free cash flow in a period the database that I pull the data from just returns a blank cell (Cell C6) and the If statement I'm using still counts that as being greater than the sector if per-se the sectors growth in that period was a negative number (Cell D6). Is there anyway to bypass this issue and put in some other type of argument in my formula in cell S6 so as to score these situations as a 0 and not a 1? Any help would be much appreciated!

    Cheers
    Attached Files Attached Files

  2. #2
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: If Statement Help

    D3 can be changed to this:

    =--AND(C6<>"",C6>D6)

    Better yet, try this in S6:

    =SUMPRODUCT((C6:Q6<>"")*(C6:Q6>D6:R6))

  3. #3
    Forum Contributor
    Join Date
    06-16-2014
    Location
    Columbia, Maryland
    MS-Off Ver
    2013
    Posts
    134

    Re: If Statement Help

    Ok so the first suggestion using the --AND formula works for that issue, but the sumproduct does not. I've attached a revised example showing what the score should actually be for each year and then the total score in S3

    Thank you!
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    06-16-2014
    Location
    Columbia, Maryland
    MS-Off Ver
    2013
    Posts
    134

    Re: If Statement Help

    Is there a way to alter the Sumproduct( formula to do what the first formula is doing for each year?

  5. #5
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: If Statement Help

    Try

    =SUMPRODUCT(($D$5:$R$5="Sector")*(C6:Q6<>"")*(C6:Q6>D6:R6))

  6. #6
    Forum Contributor
    Join Date
    06-16-2014
    Location
    Columbia, Maryland
    MS-Off Ver
    2013
    Posts
    134

    Re: If Statement Help

    This works great! Thank you

  7. #7
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: If Statement Help

    You're welcome. Glad to help!

+ 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] i have an if then statement that works, how to make it work as a with or case statement
    By dmcgov in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 06-03-2016, 03:34 PM
  2. [SOLVED] If statement to select data - nested statement - assistance
    By petitesouris in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 06-29-2015, 09:55 PM
  3. compile error expected line number statement end statement
    By mattress58 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-18-2014, 10:12 AM
  4. VBA Compile Error : line number or label or statement or end of statement
    By excellearner121 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-04-2013, 06:41 PM
  5. Replies: 4
    Last Post: 06-01-2012, 10:05 AM
  6. Replies: 4
    Last Post: 05-16-2012, 05:33 PM
  7. [SOLVED] Utilize a Select Case Statement in Target Intersect Statement
    By max57 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-29-2009, 08:55 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