+ Reply to Thread
Results 1 to 19 of 19

An IF formula who take account of the previous and next line of the first column.

  1. #1
    Registered User
    Join Date
    02-15-2015
    Location
    France
    MS-Off Ver
    2010
    Posts
    29

    An IF formula who take account of the previous and next line of the first column.

    HI,

    Ok so i will try to be clear about i'm looking for.

    In my excel file attached, there is some People who wants to do option. So if they do option 2 to 5 its ok. I they do the option 1 its not ok.

    The option 1.5 is Not ok if its link to option 1
    But ok if its link to option 2 to 5

    So this option 1.5 is a problem for me ^^ because i need to create; if(or($a2=$a1,$a2=$a3),...) or something like that to be sure that Option 1.5 is always take into account.

    I hope i have been clear

    Thanks for your help
    Attached Files Attached Files

  2. #2
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: An IF formula who take account of the previous and next line of the first column.

    What is there in the upload that tells us 1.5 is linked to any of those values? What "link" are you referring to?

  3. #3
    Registered User
    Join Date
    02-15-2015
    Location
    France
    MS-Off Ver
    2010
    Posts
    29

    Re: An IF formula who take account of the previous and next line of the first column.

    I mean, if "Lo" do the option 1 and 1.5 That is not OK. But for "max who do option 2, 1.5 and 4 it shoule be written OK

  4. #4
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: An IF formula who take account of the previous and next line of the first column.

    In C2 Cell


    =IF(VALUE(TRIM(SUBSTITUTE(UPPER(B2),"OPTION","")))<2,"Not Ok","Ok")


    Drag it down...


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  5. #5
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: An IF formula who take account of the previous and next line of the first column.

    sixthsense and I agree on all results except Max Option 1.5. This is an array formula.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Array enter means the formula must be committed by simultaneously pressing and holding down Ctrl and Shift while hitting Enter. Then drag down.

    Edit Mistake in formula. I had originally used a helper column for the SUBSTITUTE.
    Last edited by FlameRetired; 04-17-2015 at 12:49 AM.

  6. #6
    Registered User
    Join Date
    02-15-2015
    Location
    France
    MS-Off Ver
    2010
    Posts
    29

    Re: An IF formula who take account of the previous and next line of the first column.

    Hi thanks

    The thing is, in my normal table the number are replace by subject like Math, chemistry.. so i can t use a inferior or superior. If you see what i mean ?

  7. #7
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: An IF formula who take account of the previous and next line of the first column.

    Show your actual data structure with expected result for giving exact solution

  8. #8
    Registered User
    Join Date
    02-15-2015
    Location
    France
    MS-Off Ver
    2010
    Posts
    29

    Re: An IF formula who take account of the previous and next line of the first column.

    The table is more like that. Test ON.xlsx

  9. #9
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: An IF formula who take account of the previous and next line of the first column.

    Quote Originally Posted by Maximus620 View Post
    The table is more like that. Attachment 389717
    Please explain what needs to be done with the new set of data?

  10. #10
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: An IF formula who take account of the previous and next line of the first column.

    your original post looks nothing like your latest one
    all the solutions posted would not work as it was based on original file......

    what are you actually expecting as output?

    if name appears more than 1 only make first one available ?
    or if options appears more than x amount of times...only available for x times? or something else completely
    Attached Files Attached Files
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  11. #11
    Registered User
    Join Date
    02-15-2015
    Location
    France
    MS-Off Ver
    2010
    Posts
    29

    Re: An IF formula who take account of the previous and next line of the first column.

    Sorry,

    Its look strange for sure. The student can do for example (chemistry, geometry and physics) AVAILABLE. "Lo" cannot do Maths and Geometry (NOT AVAILABLE). And greg cannot do just Math (NOT AVAILABLE).
    All the other if they dont do math its AVAILABLE.

    Well my table is a way bigger, with the family name of teachers and others so i can send the real one, sorry.

    If you dont understand its ok " im not helping you a lot" in term of explanation.

  12. #12
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: An IF formula who take account of the previous and next line of the first column.

    total understand if you dont cant provide the full set of data or even part of it but you need to explain the fundamental logic of how answers are concluded

    if you cant explain the logic to the answer you want
    we cant replicate it and in turn give you the formula you are after

  13. #13
    Registered User
    Join Date
    02-15-2015
    Location
    France
    MS-Off Ver
    2010
    Posts
    29

    Re: An IF formula who take account of the previous and next line of the first column.

    I hope your weekend was good

    In this table I have few student who want to choose some option. But:

    if its written math it is "not available"
    if it is math+geometry it is "not available"
    If it is any other option it is "available"
    If it is any other option +geometry it is "available"

    This is supposed to be all the criteria. I hope it is better now

    Thanks for you time everyone.

  14. #14
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,463

    Re: An IF formula who take account of the previous and next line of the first column.

    So, if I interpret correctly, make it easy with this logic: If someone choose "Math", it writes "Not available" to all his chosen subjects?

    Try:

    =IF(COUNTIFS($A$2:$A$21,A2,$B$2:$B$21,"Math*"),"Not available","Available")
    Quang PT

  15. #15
    Registered User
    Join Date
    02-15-2015
    Location
    France
    MS-Off Ver
    2010
    Posts
    29

    Re: An IF formula who take account of the previous and next line of the first column.

    Yes, its works ! thank you.

    But how did you get the geometry available or not available ?

    I cant see it in the formula.

    I just need to be sure that geometry will be always after math, right ?
    Last edited by Maximus620; 04-20-2015 at 03:49 AM.

  16. #16
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,463

    Re: An IF formula who take account of the previous and next line of the first column.

    Quote Originally Posted by Maximus620 View Post
    I cant see it in the formula.

    I just need to be sure that geometry will be always after math, right ?
    Arcording to this:
    Quote Originally Posted by Maximus620 View Post
    if its written math it is "not available"
    if it is math+geometry it is "not available"
    If it is any other option it is "available"
    If it is any other option +geometry it is "available"
    Only "math" is not available, right?
    Other options, including geometry, is available.
    Therefore geo doesnot needed to show in the formula, it belongs to "FALSE" part of "IF"

  17. #17
    Registered User
    Join Date
    02-15-2015
    Location
    France
    MS-Off Ver
    2010
    Posts
    29

    Re: An IF formula who take account of the previous and next line of the first column.

    Yes,

    math is always not available. But Geometry is also "not available" when he is linked to math (when a student just ask for math and geometry. Otherwise all the other are available, included geometry with some other options.

  18. #18
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,463

    Re: An IF formula who take account of the previous and next line of the first column.

    Quote Originally Posted by Maximus620 View Post
    But Geometry is also "not available" when he is linked to math
    Not only geo, but any other subject which is linked to math is "not available", that COUNTIFS did:
    =IF(COUNTIFS($A$2:$A$21,A2,$B$2:$B$21,"Math*"),"Not available","Available")

  19. #19
    Registered User
    Join Date
    02-15-2015
    Location
    France
    MS-Off Ver
    2010
    Posts
    29

    Re: An IF formula who take account of the previous and next line of the first column.

    Ok,

    thank you very much, it wil be okay now i think.

+ 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. Looking for a formula that marks previous cells in line as done
    By lyndont in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-25-2014, 08:55 AM
  2. [SOLVED] Remove an account range form a column with account numbers.
    By kokapelly in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 09-09-2013, 11:34 AM
  3. What is the formula for bank account row balance column
    By Hazeldean in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-17-2005, 12:06 AM
  4. [SOLVED] Macro problem on, Yellowed line - previous line or next line.
    By Ed in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-29-2005, 07:06 PM
  5. Replies: 1
    Last Post: 03-25-2005, 01:06 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