We’d like to remind Forumites to please avoid political debate on the Forum.

This is to keep it a safe and useful space for MoneySaving discussions. Threads that are – or become – political in nature may be removed in line with the Forum’s rules. Thank you for your understanding.

📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!
The Forum now has a brand new text editor, adding a bunch of handy features to use when creating posts. Read more in our how-to guide

Excel Help Needed - IF Statement

timberflake
timberflake Posts: 1,623 Forumite
edited 10 November 2012 at 5:49PM in Techie Stuff
Hi guys, I need help with an Excel If statement!

I have a set of data, in one column I have the date received, in the next I have current date "=today()", and in the 3rd column I have days elapsed "=DATEDIF(B4,C4,"d")".

Now, what I want to do is add a "RAG Status" column with automatically updates in response to how many days have elapsed. So, if 0 days have elapsed I want the word GREEN to appear, if 1 day has elapsed I want the word AMBER, and if 2 OR MORE days have elapsed I want the word RED to appear.

Can anyone advise the best way to do this??

EDIT: It's actually more complicated than that! I also need to incorporate a status so regardless of the days elapsed if the status says "Complete" the RAG status says GREEN.

Comments

  • stevemcol
    stevemcol Posts: 1,666 Forumite
    edited 10 November 2012 at 5:56PM
    IF(d4=0,"green",IF(d4=1,"amber",IF(d4>=2,"red","")))

    or use similar formula with conditional format to actually colour the cell.
    Apparently I'm 10 years old on MSE. Happy birthday to me...etc
  • stevemcol
    stevemcol Posts: 1,666 Forumite
    is the 'complete' status in another cell?
    Apparently I'm 10 years old on MSE. Happy birthday to me...etc
  • stevemcol
    stevemcol Posts: 1,666 Forumite
    =IF(A1="complete","green",IF(D4=0,"green",IF(D4=1,"amber",IF(D4>=2,"red","") )))

    Assuming complete is in A1 which is won't be, just change.
    Apparently I'm 10 years old on MSE. Happy birthday to me...etc
  • timberflake
    timberflake Posts: 1,623 Forumite
    stevemcol wrote: »
    is the 'complete' status in another cell?

    Yes, the complete status is from a drop down in CELL H4.

    So if it says complete in H4 I want the RAG Status to always be GREEN, alternatively the RAG status will be determined by the days elapsed.
  • timberflake
    timberflake Posts: 1,623 Forumite
    Sir, you are a legend! Thanks for your help!
  • timberflake
    timberflake Posts: 1,623 Forumite
    I have another question! I'm trying to create a summary sheet which tracks the status of all types of requests received and their RAG Status.

    So, I have a request called "Agency Creation", and have inserted the following to count all requests received:
    =COUNTIF('Work Log'!G4:G1000,"Agency Creation")

    But I also want to keep track of the the RAG status of the Agency Creation requests. I therefore entered the following formula:

    =COUNTIF('Work Log'!G4:G1000,"Agency Creation") * COUNTIF('Work Log'!J4:J1000,"GREEN")

    However, this doesn't quite work as it counts all Agency Creation requests regardless of their RAG status. Any idea what I'm doing wrong?
  • stevemcol
    stevemcol Posts: 1,666 Forumite
    edited 10 November 2012 at 8:31PM
    that equation will multiply the instances of 'agency creation' by the number of 'greens'. Is that what you intended?

    i think what you want is a countif where both criteria are satisfied. there are a few ways of doing it. you might create another column, containing the equation
    =IF(and(a1="agency creation",b1="green"), true, false)
    (Tweak the cell references to suit your worksheet)

    then create a countif for instances of true.

    There are other ways.
    Apparently I'm 10 years old on MSE. Happy birthday to me...etc
This discussion has been closed.
Meet your Ambassadors

🚀 Getting Started

Hi new member!

Our Getting Started Guide will help you get the most out of the Forum

Categories

  • All Categories
  • 353.5K Banking & Borrowing
  • 254.1K Reduce Debt & Boost Income
  • 455K Spending & Discounts
  • 246.6K Work, Benefits & Business
  • 602.9K Mortgages, Homes & Bills
  • 178.1K Life & Family
  • 260.6K Travel & Transport
  • 1.5M Hobbies & Leisure
  • 16K Discuss & Feedback
  • 37.7K Read-Only Boards

Is this how you want to be seen?

We see you are using a default avatar. It takes only a few seconds to pick a picture.