+ Reply to Thread
Results 1 to 3 of 3

Using a Index and Match with sum bold VBA function

  1. #1
    Registered User
    Join Date
    09-15-2010
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Using a Index and Match with sum bold VBA function

    I am quite new to VBA, but I was able to find the macro to sumbold cells in a given range, but I am trying to lookup a certain value in another range and if that value is found then sum bold cells within another range. I have tried several different combinations of using if(xxx=xxx(sumbold( , or vlookup, index and match and,using VLOOKUP() nested inside the ISERROR() function. if result is TRUE, run the macro , etc but I cannot get the formula to work.

    For example:

    =ISERROR(VLOOKUP(A42,MIDs!A4:A16531,sumbold(MIDs!$L$4:$L$6235)+sumifbold(MIDs!$N$4:$N$6235),0))

    I am hoping that someone with more experience might be able to help. If needed I will post the spreadsheet as well.
    Thanks to anyone that can help!

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Using a Index and Match with sum bold VBA function

    Based on what you stated "If a value can be found within a certain range, then SUMBOLD the values within another range"
    =IF(ISERROR(MATCH(A42,MIDs!A4:A16531,0), 0, sumbold(MIDs!$L$4:$L$6235)+sumifbold(MIDs!$N$4:$N$6235))

    That will SUMBOLD the sum of the two ranges if there is a match of A42 in MIDs!A4:A16531. Otherwise it returns 0. Reverse the 0 and the SUMBOLDs if you want it the other way around. I'm assuming SUMBOLD is a FUNCTION not a SUB.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    09-15-2010
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Using a Index and Match with sum bold VBA function

    Thank you very much for your assistance. What I am really trying to do is to sum ONLY the bold items in a range if a value in another is matched. For example if (a4=MIDs!A4:A65000, then sum the bold items for that particular name or number. Any help you can provide further would be highly appreciated!

+ 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