+ Reply to Thread
Results 1 to 11 of 11

Proper If formula syntax for above and below number

  1. #1
    Registered User
    Join Date
    03-14-2016
    Location
    Oslo
    MS-Off Ver
    2013 Student Package
    Posts
    47

    Proper If formula syntax for above and below number

    Hi everyone!

    I was wondering if you could help me with this one.

    See the blue line in excel sheet of how I want it to look like after using a formula. I want the formula to say:

    - If column 1 goes below 30, set 1 the next 10 days. No matter which 10 numbers you have next in column 1.
    - If column 1 goes over 70, set -1 the next 10 days. No matter which 10 numbers you have next in column 1.
    - If not, set 0.
    - The row is really long so I want to draw it further in the originally excel sheet.

    Thank you so much!! :D
    Attached Files Attached Files
    Last edited by Smasen91; 04-23-2016 at 04:16 AM.

  2. #2
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,914

    Re: IF formula?

    Try this in B4...

    =IF(AND(OR(A4=1,A4=-1),MOD(SUM($A$4:A4),11)),A4,IF(B1<30,1,IF(B1>70,-1,0)))

    Copy across

  3. #3
    Registered User
    Join Date
    03-14-2016
    Location
    Oslo
    MS-Off Ver
    2013 Student Package
    Posts
    47

    Re: Help with IF formula

    Hello again. I repost this because it was locked down.

    I was wondering if you could help me with this one.

    See the blue line in excel sheet of how I want it to look like after using a formula. I tried to put in a formula, but I just receive #Name. I want the formula to say:

    - If column 1 goes below 30, set 1 the next 10 days. No matter which 10 numbers you have next in column 1.
    - If column 1 goes over 70, set -1 the next 10 days. No matter which 10 numbers you have next in column 1.
    - If not, set 0.
    - The row is really long so I want to draw it further in the originally excel sheet.

    Thank you so much!! :D
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,213

    Re: Help with IF formula

    I assume by column to mean row. What is SUMMER which gives #NAME problem?

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,213

    Re: Help with IF formula

    Try this ..

    =IF(AND(OR(A5=1,A5=-1),MOD(SUM($A$5:A5),11)),A5,IF(B1<30,1,IF(B1>=70,-1,0)))

  6. #6
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,914

    Re: Help with IF formula

    a little shorter...
    =IF(A5*MOD(SUM($A$5:A5),11),A5,IF(B1<30,1,IF(B1>=70,-1,0)))

  7. #7
    Registered User
    Join Date
    03-14-2016
    Location
    Oslo
    MS-Off Ver
    2013 Student Package
    Posts
    47

    Re: Help with IF formula

    Hi again.
    I have a new problem. It's my mistake because I did not say this earlier. But sometimes you will have empty cells. And in the originally sheet I have to drag it rightways and down. So I cant lock the A7 cell
    totally. I guess the way I did it now is the right way? However, because of the empty cells I receive a #Value Mistake. Do you know how to fix this in still have the same forumla? Because the formula is awesome! :D
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    03-14-2016
    Location
    Oslo
    MS-Off Ver
    2013 Student Package
    Posts
    47

    Re: Help with IF formula

    Hi John!
    Please see my newest post! :D

  9. #9
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,570

    Re: Proper If formula syntax for above and below number

    Modify the formula in B7 to read:
    Please Login or Register  to view this content.
    Let me know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  10. #10
    Registered User
    Join Date
    03-14-2016
    Location
    Oslo
    MS-Off Ver
    2013 Student Package
    Posts
    47

    Re: Proper If formula syntax for above and below number

    The formula works perfect! The problem is that it's too complicated to use over really big cross sectional excel sheet. Where it have to get numbers from other sheets and stuff. I have an i5 but it have to calculate around 100 000 numbers....

  11. #11
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,570

    Re: Proper If formula syntax for above and below number

    If you want the formula to be applied to another sheet then it would read:
    Please Login or Register  to view this content.
    If the issue is more complex than that then please post a file that comes closer to that actual scenario.

+ 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. Help with proper syntax for an IF(AND formula construct
    By indians207 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 06-09-2017, 03:39 PM
  2. Proper syntax for R1C1 formula in VBA
    By hbs1558 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-28-2015, 08:40 AM
  3. Proper formula syntax for an AND statement?
    By redsab in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-21-2013, 10:58 AM
  4. [SOLVED] Proper Syntax for filling out a template on Sheet2 based upon a row number from Sheet1
    By bmiller29 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-10-2013, 09:50 AM
  5. Proper syntax for EV(Expected Value) formula
    By Noobraino in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-20-2012, 09:01 PM
  6. Proper syntax for a time formula
    By nicolelschramartin in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 12-07-2012, 07:16 PM
  7. [SOLVED] Proper syntax with formula in VBA
    By kcleere in forum Excel General
    Replies: 3
    Last Post: 09-06-2012, 10:44 AM

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