+ Reply to Thread
Results 1 to 12 of 12

Display Values within a Background Filled Cell into a Different Cell

  1. #1
    Registered User
    Join Date
    09-04-2010
    Location
    Malaysia
    MS-Off Ver
    Excel 2010
    Posts
    6

    Display Values within a Background Filled Cell into a Different Cell

    Hello,

    I'm in need of help to copy and display values within a Background Filled Cell into a blank Cell. For example, in a worksheet, I have A1:B10 with data. However within this array there are some cells with it's background filled with different colours (no conditional formatting).

    E.g. the following cells are randomly filled with any colour:
    B1
    A2
    A3
    B4
    A5 and so on.

    Irregardless of what color is being used to fill these cells, is there a way to copy the value of the background filled cell in A1:B10 into C1:C10? Note: If Column A is background filled, Column B will not; and vice versa.

    Hope you can help.

    Kind regards,
    scchong

  2. #2
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: Display Values within a Background Filled Cell into a Different Cell

    does
    C1=A1
    not work?
    CC


    If you feel really indebted please consider a donation to charity. My preferred charity is ActionAid but there are plenty of worthy alternatives.

  3. #3
    Registered User
    Join Date
    09-04-2010
    Location
    Malaysia
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Display Values within a Background Filled Cell into a Different Cell

    Hello CC,

    It does, but is there a way to simplify this process by using a function? For example whether there is an IF function that I could use? The reason why I'm asking is because it's not always going to be column A that has a background fill, so I will not be able to pick up the desired value.

    Cheers,
    scchong

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Display Values within a Background Filled Cell into a Different Cell

    Hi,

    It's not clear, at least to me, what you're asking for. Presumably it's something other than simply copying and pasting either values or formats.

    Upload an example workbook showing how you want C1:C10 to appear.

    Rgds
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  5. #5
    Registered User
    Join Date
    09-04-2010
    Location
    Malaysia
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Display Values within a Background Filled Cell into a Different Cell

    Hello Richard,

    Uploaded sample workbook of desired result.
    Thank you for your time!

    Cheers,
    scchong
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: Display Values within a Background Filled Cell into a Different Cell

    Sorry, I misunderstood at first, and indeed second.

    You want C1 to be =A1 if A1 is filled or =B1 if B1 is filled

    You would need VBA to achieve this - in general conveying information by cell formatting is very difficult to manage in Excel, I wouldn't recommend it.

    Are you ok with VBA?

    hth
    Last edited by Cheeky Charlie; 09-04-2010 at 01:49 PM. Reason: bleh

  7. #7
    Registered User
    Join Date
    09-04-2010
    Location
    Malaysia
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Display Values within a Background Filled Cell into a Different Cell

    Hello CC,

    You are correct in your understanding of my issue.
    If VBA is required, I will need help with the coding. If anyone can assist, that would be much appreciated! =)

    Cheers,
    scchong

  8. #8
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: Display Values within a Background Filled Cell into a Different Cell

    This function:
    Please Login or Register  to view this content.
    used in the attached (written such that if applied to more than one cell it returns true if any of the cells inside are not blank).

    Based on:
    If Column A is background filled, Column B will not; and vice versa.
    C1=if(filled(a1),a1,b1)

    Obviously, you could reconstruct the if in different ways to accomodate both filled/neither filled.

    HTH
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    09-04-2010
    Location
    Malaysia
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Display Values within a Background Filled Cell into a Different Cell

    Hello CC,

    That works great! Is it possible to work this when theres more than 2 columns of data?
    I tried to use a range in the IF function, for example =IF(filled(E6:O6),filled(E6:O6),"N/A") it keeps returning N/A.

    I must be doing something wrong with the syntax.

    Hope you can help again! =)

    Kind regards,
    scchong

  10. #10
    Registered User
    Join Date
    09-04-2010
    Location
    Malaysia
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Display Values within a Background Filled Cell into a Different Cell

    Hello CC,

    I figured it out, I had to use nested IF function. E.g. =IF(filled(E6),E6,IF(filled(F6),F6,IF(filled(G6),G6,IF(filled(H6),H6,IF(filled(I6),I6,IF(filled(J6),J6,IF(filled(K6),K6,IF(filled(L6),L6,IF(filled(M6),M6,IF(filled(N6),N6,O6))))))))))

    That works great!

    Thank you very much for your help.

    Kind regards,
    scchong

  11. #11
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: Display Values within a Background Filled Cell into a Different Cell

    Try the help for IF (you're doing it wrong)

    I can't work out what you're trying to do with your formula, but the formula provided returns true if any of the cells in the referenced range are not blank.

  12. #12
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: Display Values within a Background Filled Cell into a Different Cell

    Good job. (I wrote my post before yours had posted)

    This UDF will achieve what you are trying to do more neatly:
    Please Login or Register  to view this content.
    Put it with the other one, then you can just call:
    =returnfilled(e6:o6)
    to return the value found in the first non-blank (coloured) cell.
    Last edited by Cheeky Charlie; 09-05-2010 at 09:47 AM. Reason: exit for

+ 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