+ Reply to Thread
Results 1 to 17 of 17

VLOOKUP And Conditional Formatting

  1. #1
    Registered User
    Join Date
    03-09-2013
    Location
    Auckland, New Zealand
    MS-Off Ver
    Excel 2010
    Posts
    11

    VLOOKUP And Conditional Formatting

    Hi, I have this formula in column F - =IF(ISNA(VLOOKUP(A4,'March 13 SOH'!A$1:D$178,3,FALSE)),"",(VLOOKUP(A4,'March 13 SOH'!A$1:D$178,3,FALSE)))

    which returns the correct value according to the sheet it looks up.

    In another cell I have conditional formatting for various colours depending on about three criteria, 2 of them relating to the F column.

    The problem is that with some cells in column F, there is no match on the sheet that is looked up and this interferes with the conditional formatting.

    When the above formula is taken out of these cells the conditional formatting works perfectly, however, I need the formula in the sheet for future use.

    From playing around it looks lie this is the same if any formula is in the cells without a match, so maybe this isn't an issue with VLOOKUP?

    Is there a way around this?

    Thanks in advance

  2. #2
    Forum Expert dredwolf's Avatar
    Join Date
    10-27-2012
    Location
    Clearwater,Canada
    MS-Off Ver
    Excel 2007
    Posts
    2,649

    Re: VLOOKUP And Conditional Formatting

    it would depend on your Conditional formatting rules, how they check for blank cells, to check for blank cells, I find this (F1="") more effective than(ISBLANK(F1)), mainly becasue a cell containing a formula, even one that returns"", is not considered blank by ISBLANK()

    Hope this helps

    Edit-
    ISBLANK() should be renamed ISEMPTY(), lol

    Edit 2-
    to test this for your self, try this
    A1:
    A2: =""
    B1: =ISBLANK(A1)
    B2: =ISBLANK(A2)
    results in:
    B1: TRUE
    B2: FALSE
    Last edited by dredwolf; 03-09-2013 at 07:11 PM.
    A picture may be worth a thousand words, BUT, a sample Workbook is worth a thousand screenshots!
    -Add a File - click advanced (next to quick post), scroll to manage attachments, click, select add files, click select files, select file, click upload, when file shows up at bottom left, click done (bottom right), click submit
    -To mark thread Solved- go top of thread,click Thread Tools,click Mark as Solved
    If you received helpful response, please remember to hit the * of that post

  3. #3
    Registered User
    Join Date
    03-09-2013
    Location
    Auckland, New Zealand
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: VLOOKUP And Conditional Formatting

    Thanks for the quick reply Dredwolf, but no joy.

    Here is a link to a section of the sheet - http://wikisend.com/download/177288/...Book Short.xls

    From row 5 to 15 are examples of the problem. The red cells in column N should be clear, no colour, the same as on row 16.
    Rows 5 to 15 have no match in the "March13 SOH" sheet that is used to get the values into the F column.

    Hopefully this makes sense?

    Cheers

  4. #4
    Forum Expert dredwolf's Avatar
    Join Date
    10-27-2012
    Location
    Clearwater,Canada
    MS-Off Ver
    Excel 2007
    Posts
    2,649

    Re: VLOOKUP And Conditional Formatting

    If you upload it HERE (see my signature for details), then I will look at it

  5. #5
    Registered User
    Join Date
    03-09-2013
    Location
    Auckland, New Zealand
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: VLOOKUP And Conditional Formatting

    Here you go Dred.
    Attached Files Attached Files

  6. #6
    Forum Expert dredwolf's Avatar
    Join Date
    10-27-2012
    Location
    Clearwater,Canada
    MS-Off Ver
    Excel 2007
    Posts
    2,649

    Re: VLOOKUP And Conditional Formatting

    okay, what am I seeing here? give me the first cell that is a problem( meaning, not formatted right), is it the red cells or... what ?and if the refernce cell(s) are blank, should it be green or just regular formatting ?
    Last edited by dredwolf; 03-09-2013 at 10:48 PM.

  7. #7
    Registered User
    Join Date
    03-09-2013
    Location
    Auckland, New Zealand
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: VLOOKUP And Conditional Formatting

    Apologies, I should of explained this.

    The cells in red are the ones that have been conditionally formatted.
    If there is no value in the F column of that row, depending on if there are values under the months columns to the right will decide the colour.
    As there is no value in the F column and no values in any of the month columns to the right, the red column should be empty, clear, like in row 16.
    I think that maybe the columns that been CF'd need adjusting.

    If you have a look under the Feb Wk 2 tab, that is what it should look like, but this is without the VLOOKUP formula.

    Hope this explains a bit more.

  8. #8
    Forum Expert dredwolf's Avatar
    Join Date
    10-27-2012
    Location
    Clearwater,Canada
    MS-Off Ver
    Excel 2007
    Posts
    2,649

    Re: VLOOKUP And Conditional Formatting

    SO if column F is blank AND no values to the right, it should NOT be highlighted? I think you have lost me, I would like to see some expected output (Hand done if necessary, with an explanation of WHY it's that way...) right now, I'M completely lost as how the cell coloring takes place

  9. #9
    Forum Expert dredwolf's Avatar
    Join Date
    10-27-2012
    Location
    Clearwater,Canada
    MS-Off Ver
    Excel 2007
    Posts
    2,649

    Re: VLOOKUP And Conditional Formatting

    If Feb rules work, just apply the same to Mar, if Feb Rules do not work, then ... again confused

  10. #10
    Registered User
    Join Date
    03-09-2013
    Location
    Auckland, New Zealand
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: VLOOKUP And Conditional Formatting

    You're correct, if no values in F or the months columns, both N & O should be blank.
    Rows 5 - 15 are the problem ones.
    Columns N & O have both been conditionally formatted. The idea is to put up different coloured flags if product is in stock but has/has not sold recently and we have stock.
    If no stock (F) then N & O should not be coloured, even if there have been sales in the last 12 months, as in row 16.

    Rows 5-15 have no match in the sheet March 13 SOH, so maybe this is the problem, because if a match is found, like row 16, it works correctly.
    I have uploaded the workbook again and have put 1 into the March column in row 5, which has turned it green. It should only be green if we had stock.
    For some reason it seems like the conditional formatted cells see a vlaue even though it is blank. I have also tried it with a 0 in F5, but no joy.

    If the formula from F5 is deleted, Columns N & O work correctly.

    Clear as mud? Hopefully not.

    Cheers
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    03-09-2013
    Location
    Auckland, New Zealand
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: VLOOKUP And Conditional Formatting

    Quote Originally Posted by dredwolf View Post
    If Feb rules work, just apply the same to Mar, if Feb Rules do not work, then ... again confused
    There are no formulas in the month columns. It is only some in column F (F5 - F15) in this example are being a pain.

    Rows 16 and 17 work fine, but as mentioned above, that must be because they have a match for the Vlookup formula on sheet "March 13 Sales".

  12. #12
    Forum Expert dredwolf's Avatar
    Join Date
    10-27-2012
    Location
    Clearwater,Canada
    MS-Off Ver
    Excel 2007
    Posts
    2,649

    Re: VLOOKUP And Conditional Formatting

    So, if column F is blank...no highlight, regardless of what is in the other cells?

    I mean if the row we are in, column f is blank, the cell does not get highlighted, I am trying to determine the main rule here...
    Last edited by dredwolf; 03-10-2013 at 12:28 AM.

  13. #13
    Registered User
    Join Date
    03-09-2013
    Location
    Auckland, New Zealand
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: VLOOKUP And Conditional Formatting

    That's it Dred.

    Trouble is, columns N & O don't see some F as blank, as mentioned above.

  14. #14
    Forum Expert dredwolf's Avatar
    Join Date
    10-27-2012
    Location
    Clearwater,Canada
    MS-Off Ver
    Excel 2007
    Posts
    2,649

    Re: VLOOKUP And Conditional Formatting

    okay highlight affected range, goto CF, New rule, Use Formula.. =$F4="",Format,Fill,'No Color' Button, OK,OK (this is assuming the range starts in row 4), go back to CF,Manage Rules..move that rule to the top, then click the 'Stop If True' checkbox for it..

    Hope that helps

  15. #15
    Forum Expert dredwolf's Avatar
    Join Date
    10-27-2012
    Location
    Clearwater,Canada
    MS-Off Ver
    Excel 2007
    Posts
    2,649

    Re: VLOOKUP And Conditional Formatting

    Here's the workbook with that applied (Note- I erased (I think all) the other attempts at it)
    Attached Files Attached Files

  16. #16
    Registered User
    Join Date
    03-09-2013
    Location
    Auckland, New Zealand
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: VLOOKUP And Conditional Formatting

    Superb!

    Thanks for all of your help.

  17. #17
    Forum Expert dredwolf's Avatar
    Join Date
    10-27-2012
    Location
    Clearwater,Canada
    MS-Off Ver
    Excel 2007
    Posts
    2,649

    Re: VLOOKUP And Conditional Formatting

    You are quite welcome
    I Do want to point out though, the solution IS what I offered in my first post

+ 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