+ Reply to Thread
Results 1 to 9 of 9

If statement from a cell colour

  1. #1
    Registered User
    Join Date
    06-16-2011
    Location
    Chippenham, England
    MS-Off Ver
    Excel 2003
    Posts
    8

    Question If statement from a cell colour

    Hi all,

    I'm new to the forum, so be gentle!!!!!!!! I'm sure this question has been asked before, but I can't find it, so thought this was the quickest way...

    I have a fairly simple spreadsheet that is around 40 columns wide by 350 rows deep. Each column ascertains to a specific machine in the factory I work and each row to a day of the year. Each machine can have a specific type of breakdown or stoppage so I have specific colours within the cells to identify the type of breakdown (also with a number value detailing the number of cycles of the machine prior to the stoppage).

    What I want to do, is write an "IF" statement on a separate sheet to interrogate this data sheet so that if a specific cell is Yellow for example, it'll tell me that on this day on this machine, it has had the type of breakdown that the yellow cell colour refers to. The purpose is to easily see how many breakdowns / stoppages, are occurring on each machine.

    Is there anyway I can write an "IF" statement to identify the background colour of a cell and return a text value if the colour is a certain colour?

    Many thanks in advance...

    Kev.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,614

    Re: If statement from a cell colour

    Since you use 2003 you'll need macro for this.

    however, if your colors are associated with numbers then you can create formula over numbers (not colors).

    but for this we'll need example workbook.

  3. #3
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: If statement from a cell colour

    Hi,

    Are the cells coloured manually or by conditional formatting?

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  4. #4
    Registered User
    Join Date
    06-16-2011
    Location
    Chippenham, England
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: If statement from a cell colour

    Hi, thanks for the speedy replies...

    Dom, the cells are coloured manually, not with conditional formatting.

    zbor, I'll get a copy of the file added in to have a look at... I actually use 2010, but the people who use the spreadsheet are still on 2003 so the file needs to still be in 2003 so they can use it.

  5. #5
    Registered User
    Join Date
    06-16-2011
    Location
    Chippenham, England
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: If statement from a cell colour

    As requested, the file in question...
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    06-16-2011
    Location
    Chippenham, England
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: If statement from a cell colour

    Hi there again...

    I was wondering if anyone else could shed any light on this problem... It's a sheet I'm using that hopefully will prioritise remedial work in the factory I work in to help us focus on improving breakdowns!!!!

    Any suggestions would be greatly appreciated!!!!!

  7. #7
    Registered User
    Join Date
    06-16-2011
    Location
    Chippenham, England
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: If statement from a cell colour

    Hi again...

    I'm sure someone out there will have an answer or solution to this one... I'm starting to pull my hair out, and I ain't got much of that left either?!!!?!??!!!

    Any help is greatly appreciated...

    Kev.

  8. #8
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: If statement from a cell colour

    I'm not able to download your attachment for some reason. Out firewall keeps blocking it.

    My advice would be to avoid trying to write formula based on the colour that you have formatted a cell. It would involve using a vba user defined function and those that are based on the formatting of cells do not calculate unless you manually force a full sheet recalc.

    Would it not be possible to make entries in the cells that relate to the possible events and conditionally format the cells based on that for appearance? You will find it much easier to base any calculations or formula on actual data in a cell than on the formatting of it.

    Dom

  9. #9
    Registered User
    Join Date
    06-16-2011
    Location
    Chippenham, England
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: If statement from a cell colour

    Hi Domski,

    Unfortunatley the guys who use the sheet can't really change what they enter into the sheet so the only way I thought of doing what they need is via the formatting of the cell.

    Thanks anyway for taking the time to reply, I guess I'll have to re-think how to go about it.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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