+ Reply to Thread
Results 1 to 9 of 9

If statement to select data - nested statement - assistance

  1. #1
    Registered User
    Join Date
    05-27-2014
    Location
    Australia
    MS-Off Ver
    2016
    Posts
    57

    If statement to select data - nested statement - assistance

    Dear Members,

    Thank you for your help in advance. I have attached a file with comments to explain what I am after.

    Basically I have a list of students with a date access to a website

    If they have accessed within 7 days from today - they should have a value of 10 + the value of Column D
    If they have accessed within the last 14 days it should be a different value 40 + the value of Column D - it is a bigger score as they did not accessed within the last seven days
    finally

    If they have accessed within 28 days from today - they should have a value of 75 + the value of Column D

    I am sure it is pretty simple but all I could do was to start with a simple if statement and got lost in the logic

    Thanks
    EIM tool.xlsx
    Last edited by petitesouris; 06-29-2015 at 09:01 PM. Reason: to follow rules

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Help needed with Basic Formula

    Hello,

    with only three different values, you could do a nested IF statement. With more values, you may want to use a lookup table approach. In any case, it would be easiest if you insert a column where the number of days is calculated. Then you can use this in many formulas without doing the calculation over and over again.

    I'm not sure if the three columns with 0 and 1 are just for illustration. You say you want to return a Yes, but the formula has a "1". Just change that to a "Yes".

    Insert a column between G and H and enter this formula

    =TODAY()-G2

    This gives you the number of days since the last access. This formula is now in column H.

    In the (now) column L you can use

    =IF(H2<=7,10,IF(H2<=14,40,75))+D2

    cheers, teylyn

  3. #3
    Registered User
    Join Date
    05-27-2014
    Location
    Australia
    MS-Off Ver
    2016
    Posts
    57

    Re: Help needed with Basic Formula

    Thank you for your reply.

    It says 1 and 0 that is the value it did return I did not know how to change it. That was me poorly trying to write a formula to see if they did log within the time frame.

    Basically I do not need to calculate the number of days but to apply a value if the meet the criteria of login within the last seven days -if they did log they got the lowest value and so on...
    Thanks I will try your formula to see if it does the trick or nor

  4. #4
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,598

    Re: Help needed with Basic Formula

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution.

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change a Title go to your first post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    Ben Van Johnson

  5. #5
    Registered User
    Join Date
    05-27-2014
    Location
    Australia
    MS-Off Ver
    2016
    Posts
    57

    Re: Help needed with Basic Formula

    EIM tool.xlsx
    Ok it does nearly work :-) thank you so much the calculation of the day and the automatic add up of the value is wonderful it does the job exactly the way I wanted so much easier than my road!!! I did learn how to change the value to yes or no... but for the file I just type the way I would like it to appear

    One more request if you can help me... for a quick overview I would like to be able that the column with access within the 7 days bring a Yes if they have accessed within the 7 days but no data in the other column unless it was accessed within 14 days and accessed within 28 days

  6. #6
    Registered User
    Join Date
    05-27-2014
    Location
    Australia
    MS-Off Ver
    2016
    Posts
    57

    Re: Help needed with Basic Formula

    I have edited the post but sometimes it is not easy to describe what you want or what is the issue is if your excel knowledge is limited. I hope I have been giving an explicit enough title.

  7. #7
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: If statement to select data - nested statement - assistance

    Last 7 days in cell I2: =IF(H2<=7,"Yes","")
    Last 14 days in cell J2: =IF(AND(H2>7,H2<=14),"Yes","")
    Last 28 or more in cell K2 =IF(H2>14,"Yes","")

    copy down.

  8. #8
    Registered User
    Join Date
    05-27-2014
    Location
    Australia
    MS-Off Ver
    2016
    Posts
    57

    Re: If statement to select data - nested statement - assistance

    Thank you very much works except the second one ... nearly there I had something else that got me nearly there but it was the and fnction I could not get it to work Thank you so much nearly there

  9. #9
    Registered User
    Join Date
    05-27-2014
    Location
    Australia
    MS-Off Ver
    2016
    Posts
    57

    Re: If statement to select data - nested statement - assistance

    Evey thing works so well... Thank you heaps !!!!

+ 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. Basic Charting help needed
    By An album cover in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 10-16-2014, 10:46 AM
  2. [SOLVED] Basic macro grammar help needed
    By chococ in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-18-2014, 05:37 PM
  3. Basic Macro needed
    By alanbenjy in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-02-2010, 07:31 AM
  4. basic formula help needed
    By Malchemist in forum Excel General
    Replies: 2
    Last Post: 05-31-2010, 06:49 AM
  5. Basic IF function help needed
    By EME in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-29-2009, 05:51 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