+ Reply to Thread
Results 1 to 6 of 6

if statement false, evaluate next row

  1. #1
    Registered User
    Join Date
    11-09-2019
    Location
    Kentucky, USA
    MS-Off Ver
    2016
    Posts
    3

    if statement false, evaluate next row

    I have non-contiguous dates in column A and corresponding numbers in column B. I have contiguous dates in column C and corresponding numbers in column D. I want to multiply a single column D value (e.g. D1) by a single column B value (e.g. B1) only if the dates in column C fall between adjacent dates in column A (e.g. A1-A2). This is fairly straightforward using the array formula in E1, {=IF(($C$1:$C$4>=$A$1:$A$4)*($C$1:$C$4<=$A$1:$A$4),D1*$B$1)}. The problem with this formula arises when the contiguous date in column C is no longer bounded by the first set of adjacent dates in column A. In this case, I want to multiply the values in column D with the next value in column B (e.g. B2). My formula will always multiply the value in column D with B1 (i.e. D1*$B$1). The value that I want in E5 (i.e. the situation when the date in column C is not bounded by the first set of adjacent dates in column A) is shown in F5 (=D5*$B$2). I do not know how to do this in excel. Also, I would prefer not to change the non-contiguous dates in column A to contiguous dates, which would make this problem trivial. Please help
    Attached Files Attached Files

  2. #2
    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
    80,455

    Re: if statement false, evaluate next row

    Welcome to the forum

    In the sample workbook you have not mocked up the results you want to see. You need to do this manually.
    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.

  3. #3
    Registered User
    Join Date
    11-09-2019
    Location
    Kentucky, USA
    MS-Off Ver
    2016
    Posts
    3

    Re: if statement false, evaluate next row

    I am sorry. I do not know what you are talking about. Mocked up?

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

    Re: if statement false, evaluate next row

    Yes - mocked up.

    You have described a change you want to make in the workbook. Where in the workbook have you shown us what you expect that to look like in practice?

  5. #5
    Registered User
    Join Date
    11-09-2019
    Location
    Kentucky, USA
    MS-Off Ver
    2016
    Posts
    3

    Re: if statement false, evaluate next row

    The value that I want is in F5. This is described in the original post as "The value that I want in E5 (i.e. the situation when the date in column C is not bounded by the first set of adjacent dates in column A) is shown in F5 (=D5*$B$2)."

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

    Re: if statement false, evaluate next row

    I'm sure someone will follow, but I don't - sorry.

+ 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. If statement to evaluate the next record...
    By nessabell3 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-19-2013, 03:12 AM
  2. If statement, answer is false, hide false.
    By Mel B in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-07-2013, 06:36 PM
  3. [SOLVED] if false evaluate next row
    By cabaret in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 06-13-2012, 06:05 AM
  4. Why does range evaluate to nothing following set statement
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-07-2011, 11:06 AM
  5. Why does range evaluate to nothing following set statement
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-07-2011, 07:43 AM
  6. Use evaluate instead of range in VBA IF statement
    By skysurfer in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-29-2010, 06:01 PM
  7. Evaluate:IF statement
    By billansley in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-14-2005, 02:05 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