+ Reply to Thread
Results 1 to 6 of 6

nesting multiple formulas involving cell properties

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    12-03-2008
    Location
    Key West, FL
    MS-Off Ver
    365 Apps for Enterprise
    Posts
    666

    nesting multiple formulas involving cell properties

    First, thanks to everyone who's helped me get this far.

    I need to manipulate some table data in order to perpare it for further analysis.

    I have a workbook (example attached) with an example table. The workbook has two worksheets: Finished and Orig

    In the Orig, note the following:

    1. Some of the cells have a mixture of text and numbers.
    2. The cells with data have either green or red fonts. (for positive or negative).
    3. Some cells are blank. (meaning no activity for the month) Per an earlier thread, I need blank cells to remain blank, as opposed to a "0" because a "0" corrupts my formulas.

    In the Finished sheet, I need the following:

    1. For blank cells to remain blank, I'm using this formula:

    =IF(C13<>0,C13,"")]
    2. To turn red fonts into a negative number, I first installed a.bas module from here: http://www.cpearson.com/excel/colors.aspx which determines cell properties: The "51" below indicates that the font color is green. If it is not green, then we multiply x -1 to create a negative number.

    =if((=COLORINDEXOFONECELL(V15,TRUE,1))=51,+v15*1,v15*-1)
    3. In the cells with a mixture of numbers and text, the text is always "est" so I created this formula to remove the "est."


    =SUBSTITUTE(C13,"est","")
    Now the problem!

    How do I combine these formulas so that it all works? If I were to use formula 2 first, then I'll get a "0" for the solution. This screws up the ability to make distinctions between blank cells and true 0's.

    If I were to use forumla 3 first, the result does not preserve the original font color. So we don't know if the number is positive or negative.

    If I use formula 1 first, this doesn't help because forumua 2 will put a "0" back into the cell.

    So I need a guru to help me out here. My IQ isn't high enough to combine all this into a workable solution!

    Thanks
    Attached Files Attached Files
    Last edited by jrtaylor; 03-05-2011 at 12:44 AM. Reason: solved. Many thanks!

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,861

    Re: nesting multiple formulas involving cell properties

    See formula 4 for solution
    Attached Files Attached Files
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,861

    Re: nesting multiple formulas involving cell properties

    Just for completeness here's the formula

    =IF(B8="","",SUBSTITUTE(B8,"est","")*IF(COLORINDEXOFONECELL(B8,TRUE,1)=51,1,-1))

  4. #4
    Forum Contributor
    Join Date
    12-03-2008
    Location
    Key West, FL
    MS-Off Ver
    365 Apps for Enterprise
    Posts
    666

    Re: nesting multiple formulas involving cell properties

    Thanks again. After making my original post I saw that there was another non-number character which appears in some of the original data.

    We've already solved the problem of the "est" but now I see that some numbers have an asterick after them, such as:

    6*


    How would I add another subtitution phrase in the above formula, to get rid of the astericks (as well as the est)?

    Thanks again!

  5. #5
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,861

    Re: nesting multiple formulas involving cell properties

    Quote Originally Posted by 6StringJazzer View Post
    =IF(B8="","",SUBSTITUTE(SUBSTITUTE(B8,"*",""),"est","")*IF(COLORINDEXOFONECELL(B8,TRUE,1)=51,1,-1))
    I'm sorry if this comes off being pedantic but my nature requires me to tell you that the word is "asterisk".

  6. #6
    Forum Contributor
    Join Date
    12-03-2008
    Location
    Key West, FL
    MS-Off Ver
    365 Apps for Enterprise
    Posts
    666

    Re: nesting multiple formulas involving cell properties

    Ha! Double thanks.

+ 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