none
Conditional Formatting of Cells Based on Median Value RRS feed

All replies

  • Actually, my question is entirely about using the Open XML SDK to accomplish the task I describe. NOT using Excel itself. Please read the post carefully and then  move it back where it was. 

    Thank you

    Tuesday, June 6, 2017 8:15 AM
  • Hi JimNickFL,

    in Open XML you need to use Conditional formatting class.

    with the help of that you can able to apply conditional formatting.

    <conditionalFormatting sqref="E3:E9">
    
            <cfRule type="cellIs" dxfId="0" priority="1" operator="greaterThan">
    
                <formula>0.5</formula>
    
            </cfRule>
    
        </conditionalFormatting>
    

    Reference:

    Working with conditional formatting (Open XML SDK)

    ConditionalFormatting class

    ConditionalFormattingRule class

    below is link for methods and properties

    ConditionalFormatting methods

    ConditionalFormatting properties

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, June 7, 2017 6:38 AM
    Moderator
  • Hi JimNickFL,

    Has your issue been resolved?

    >> My question is how to use the median value to format cells above or below that value.

    Do you mean you want to format the cells in OpenXML, and then it could be used Excel when you change the values dynamically?

    If so, I am afraid it is impossible. The format condition did not accept formula.

    For a workaround, I think you could create a hidden cell to store the formula, and then set the conditional formatting with this cell reference.

    Best Regards,

    Edward


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, June 27, 2017 10:08 AM