+ Reply to Thread
Results 1 to 23 of 23

IF or Vlookup

  1. #1
    Registered User
    Join Date
    12-31-2012
    Location
    bradford, england
    MS-Off Ver
    Excel 2010
    Posts
    35

    Question IF or Vlookup

    Hi All,

    Im new to this forum, and was wandering if you can help me with below spreadhseet query.

    I have field called Date of Inspection, cell D1. (21/12/2012)

    I have a field call Report Due, cell C2.

    I want to create a formula that looks at the D1, and then the current date Today(). If the inspection report has not been sent within a 15 day period the cell will become highlighted in red, and say report due. And if the report has been received the cell will remain highlighted in yellow.

    I want to create an alert that tell's me if the report has not been received.


    I hope you can help.........

  2. #2
    Forum Expert Kevin UK's Avatar
    Join Date
    12-07-2010
    Location
    Radstock, Somerset
    MS-Off Ver
    365
    Posts
    1,922

    Re: IF or Vlookup

    Hi safir4

    Do you mean like this!

    In C2: =IF(TODAY()-D1>15,"Report Due","")

    And conditional format, new rule: =TODAY()-$D$1>15
    Regards Kevin


    Merged Cells (They are the work of the devil!!!)

  3. #3
    Registered User
    Join Date
    12-31-2012
    Location
    bradford, england
    MS-Off Ver
    Excel 2010
    Posts
    35

    Re: IF or Vlookup

    Hi Kevin,

    Thank you very much for your help this has helped me greatly.

    If C2 Displays "Report Due", how do i make the field turn red everytime the formula returns that answer.

    Once last question.

    Just say I have 4 fields called (Report 1, Report 2, Report 3, Report)

    So when ever I receive one of the 4 reports I will fill in the cell and say either yes or No.

    I want to create a formula in E1, which looks at all 4 fields and if they say yes then the say "All reports received". But if we are awaiting for one of the reports to be received and cell say's No, then E1 should say "Awaiting Reports".

    Your help would be greatly appreciated.

    Thank you
    Last edited by safir4; 12-31-2012 at 03:03 PM.

  4. #4
    Registered User
    Join Date
    12-31-2012
    Location
    bradford, england
    MS-Off Ver
    Excel 2010
    Posts
    35

    Re: IF or Vlookup

    Hi Kevin,

    Thank you very much for your help this has helped me greatly.

    If C2 Displays "Report Due", how do i make the field turn red everytime the formula returns that answer.

    Once last question.

    Just say I have 4 fields called (Report 1, Report 2, Report 3, Report)

    So when ever I receive one of the 4 reports I will fill in the cell and say either yes or No.

    I want to create a formula in E1, which looks at all 4 fields and if they say yes then the say "All reports received". But if we are awaiting for one of the reports to be received and cell say's No, then E1 should say "Awaiting Reports".

    Your help would be greatly appreciated.

    Thank you

  5. #5
    Valued Forum Contributor
    Join Date
    07-27-2012
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    826

    Re: IF or Vlookup

    safir,

    Assuming your "fields" are A1, B1, C1 & D1, in E1 enter: =IF(AND(A1="Yes",B1="Yes",C1="Yes",D1="Yes"),"All reports received","Awaiting reports")
    Last edited by BB1972; 12-31-2012 at 03:09 PM. Reason: Entered E2 instead of E1
    Brendan.


    __________________________________________________________________________________________________
    Things to consider:

    1) You can thank any poster by clicking the * at the left of a helpful post.
    2) You can help to keep the forum tidy by marking your thread as "Solved", if it has been answered to your satisfaction.
    3) Help us to help you, by uploading a sample workbook, showing the type of data you're dealing with, and clearly indicating what the results should be.

  6. #6
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: IF or Vlookup

    =if(countif(b1:d1,"yes")=4,"all reports recieved","awaiting reports")
    or if(countif(b1:d1,"no"),"awaiting reports","all reports recieved")
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  7. #7
    Registered User
    Join Date
    12-31-2012
    Location
    bradford, england
    MS-Off Ver
    Excel 2010
    Posts
    35

    Re: IF or Vlookup

    Martin I've tried above formula and its not working, im typing it up as below:


    =if(countif(b1:d1,"yes")=4,"all reports recieved","awaiting reports") or if(countif(b1:d1,"no"),"awaiting reports","all reports recieved")

    Please tell me if I am inserting it correctly, if not can you please advise.

  8. #8
    Valued Forum Contributor
    Join Date
    07-27-2012
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    826

    Re: IF or Vlookup

    They are two separate formulas:

    Formula 1
    =if(countif(b1:d1,"yes")=4,"all reports recieved","awaiting reports")

    Formula 2
    =if(countif(b1:d1,"no"),"awaiting reports","all reports recieved")

  9. #9
    Registered User
    Join Date
    12-31-2012
    Location
    bradford, england
    MS-Off Ver
    Excel 2010
    Posts
    35

    Re: IF or Vlookup

    How do i convert the 2 formulas into one.

    What i mean is:

    IF B1:D1 = Yes, then "All reports received", but if B1:D1 is No then "Awaiting reports".

    Please Note all 4 cell's have to say yes, in-order for the answer from the formula to be "All reports received"

  10. #10
    Valued Forum Contributor
    Join Date
    09-10-2012
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2010
    Posts
    929

    Re: IF or Vlookup

    safir,

    They are logically the same formula... just use the first one...

  11. #11
    Registered User
    Join Date
    12-31-2012
    Location
    bradford, england
    MS-Off Ver
    Excel 2010
    Posts
    35

    Re: IF or Vlookup

    I've tried both the above fomulas, and they don't work, isn't giving the correct answer.

  12. #12
    Valued Forum Contributor
    Join Date
    07-27-2012
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    826

    Re: IF or Vlookup

    Did you try the formula I provided you with in post # 5?

  13. #13
    Registered User
    Join Date
    12-31-2012
    Location
    bradford, england
    MS-Off Ver
    Excel 2010
    Posts
    35

    Re: IF or Vlookup

    My mistake i've got the formul to work.
    d
    Thank you all for your time and help. Much appreciate

  14. #14
    Valued Forum Contributor
    Join Date
    09-10-2012
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2010
    Posts
    929

    Re: IF or Vlookup

    safir,

    If BB's formula also does not work, I suggest that you attach a sample spreadsheet with the formula that you are using... any of the formulas should work above...

    To attach a spreadsheet, click on Go Advanced, then seach for a paperclip...

  15. #15
    Registered User
    Join Date
    12-31-2012
    Location
    bradford, england
    MS-Off Ver
    Excel 2010
    Posts
    35

    Re: IF or Vlookup

    Thank you Djapigo. In the future ill attach the spreadsheet.

    A question (In post 2 I was given a formula, how do i make the cell colour change "Red" for example when the answer is "Report Due".

  16. #16
    Valued Forum Contributor
    Join Date
    07-27-2012
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    826

    Re: IF or Vlookup

    safir,

    Click on cell E1, then on the Home tab in the Ribbon, click on Conditional Formatting, New Rule, Use a formula to determine which cells to format, then type:

    Please Login or Register  to view this content.
    Click on Format, Fill, select your colour, then Ok, then Ok, then Apply.

  17. #17
    Valued Forum Contributor
    Join Date
    09-10-2012
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2010
    Posts
    929

    Re: IF or Vlookup

    Hi safir,

    Kevin's suggestion is to use Conditional Formatting, which is under the Home tab under Styles...

    Highlight your range that you want special formatting, press the Conditional Formatting, New Rule, Use a formula to determine which cells to format...

    Then use Kevin's formula in the box, press Format... and select your "Red" formatting...

    Let me know if you are still stuck...

    re-post: Sorry Brendan, nice work...

  18. #18
    Registered User
    Join Date
    12-31-2012
    Location
    bradford, england
    MS-Off Ver
    Excel 2010
    Posts
    35

    Re: IF or Vlookup

    Test.xlsx

    Guys i've attached the spreasheet that I am working on with post. As you will it applies red to all the cell's, rathern then only highligting the cell's that say "Reports Due" red.

    What I am looking for is if the cell's say:

    * Reports Due (Then the cell should highlight it self red)
    * Not Due (Then the cell should highlight it seld yellow)

    Your help will be greatly appreciated.

  19. #19
    Valued Forum Contributor
    Join Date
    09-10-2012
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2010
    Posts
    929

    Re: IF or Vlookup

    Hi safir,

    Use Brendan's formula...
    =F5="Reports Due" with the red fill
    =F5="Not Due" with the yellow fill

    Here's a screen shot of how your conditional formatting should look like in the end...



    Let us know if this is not what you want...

    Dennis
    Attached Images Attached Images

  20. #20
    Registered User
    Join Date
    12-31-2012
    Location
    bradford, england
    MS-Off Ver
    Excel 2010
    Posts
    35

    Re: IF or Vlookup

    Thank you. Will do that

  21. #21
    Forum Expert Kevin UK's Avatar
    Join Date
    12-07-2010
    Location
    Radstock, Somerset
    MS-Off Ver
    365
    Posts
    1,922

    Re: IF or Vlookup

    Hi safir4

    Late to the party, but i see you have it sorted. Attached is your file with the formatting applied. i have also applied data validation to cells G5:J12, so just click the down arrows for yes or No.
    Attached Files Attached Files

  22. #22
    Registered User
    Join Date
    12-31-2012
    Location
    bradford, england
    MS-Off Ver
    Excel 2010
    Posts
    35

    Re: IF or Vlookup

    I've had to re-open my post as I need so further help.

    If you look at the attached spreadhsheet, when their is no date inserted within cell C8, the formula in DE returns the answer as (#VALUE!), What do i need to add into the formula that say's if their is no valuve within C8 the result in D8 should say blank.

    Your help would be greatly appreciated.

    Test(1).xlsx

  23. #23
    Valued Forum Contributor
    Join Date
    07-27-2012
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    826

    Re: IF or Vlookup

    safir,

    You can do a couple of things. Either wrapping your entire formula in D8 with IFERROR like this:

    Please Login or Register  to view this content.
    will return a blank ("") if your formula evaluates/results in an error, which is what happens when you ask Excel "is today, minus (blank) greater than 15".

    You can also just leave the cells in Column C blank (rather than typing in "(Blank)", as you have done) - if you do that, as I have done in C10, you will see the D10 says "Reports Due", rather than evaluating to an error.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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