Results 1 to 6 of 6

Streamlining IF command

Threaded View

cynicor Streamlining IF command 05-29-2012, 10:41 PM
protonLeah Re: Streamlining IF command 05-30-2012, 12:48 AM
cynicor Re: Streamlining IF command 05-30-2012, 08:48 PM
protonLeah Re: Streamlining IF command 06-03-2012, 12:37 AM
cynicor Re: Streamlining IF command 06-05-2012, 01:28 AM
cynicor Re: Streamlining IF command 06-06-2012, 11:21 PM
  1. #1
    Registered User
    Join Date
    05-29-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    4

    Streamlining IF command

    Hi.

    Firstly, I have tried a search to no avail, but I am not even sure if I am using the right terms to be honest.
    I have an excel spreadsheet, it is actually a roster. Shift times are variable but each day three cells will be coloured differently (so one purple, one blue, one green) and the others all white.
    I am looking for a formula that will display the person in colour x for that day.
    I have had some success making a function for background colour from the internet, and I can use the IF function for up to 8 of the 10 columns but it then hits the length limit. (Excel 2010) It also seems very unwieldy and would be hard to change easily. I am sure there is a better way of doing this, or by making a VBA function.
    My spreadsheet is Columns for person and rows for each day of the week, so below is what I have so far (the person's name is on Row 5):
    =IF(CellColour(18,4)=39,(D5),IF(CellColour(18,5)=39,(E5),IF(CellColour(18,6)=39,(F5),IF(CellColour(18,7)=39,(G5)))))
    The VBA function (from a website) is
    Function CellColour(Irow As Integer, Icol As Integer) As Long
    CellColour = Cells(Irow, Icol).Interior.ColorIndex
    End Function
    Is anyone able to offer any help please?

    Thanks,
    Jon
    Attached Files Attached Files
    Last edited by cynicor; 05-30-2012 at 08:47 PM.

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