We’d like to remind Forumites to please avoid political debate on the Forum.

This is to keep it a safe and useful space for MoneySaving discussions. Threads that are – or become – political in nature may be removed in line with the Forum’s rules. Thank you for your understanding.

📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!

Excel Macro Help?

13»

Comments

  • f1charlie
    f1charlie Posts: 1,228 Forumite
    Great! I'm glad my (very) little bit of knowledge came in useful!
    Charlie
  • f1charlie
    f1charlie Posts: 1,228 Forumite
    Put in the cell where you are calculating the average:

    =IF(ISERROR(AVERAGE(B20,C20,D20)),"",AVERAGE(B20,C20,D20))

    replacing the cells with the ones you want, of course!
    Charlie
  • Use the =if(iserror(... function so for the cell under 2 where the 1st div/o appears type this......

    where 01.09.07 is in cell D1 and 02.09.07 is in cell E1 and so forth:-

    =if(iserror(average(D3:G3)),"",(average(D3:G3)))

    substitute the "" with a 0 if thats what you want it to read as. or "xx" where XX = whatever txt you want to see.

    This basically says IF the formula you are using returns an error put the "" alternitively show the result of the formula if it returns a value. I assume that the formula you have used is =average(D3:G3)?

    hope this helps fella
  • By the way i can think of several better macros for your find function, including the find in range function which would probably be best. also there are some functions that can find parts of an input in a given range that might help you allow for more flexibity in the input.

    Unfortunatley i live in the VBA matrix all day long automating stuff. Strangley i quite enjoy it, i think i may be a little sick, but it keeps me in beer tokens and off the street!

    Pm me if you need any more help

    Regards
    Adam
  • nice one guys worked a treat! Tell me more about these search functions sounds brilliant!

    Cheers,
    Help me to help you :santa2:
  • rmg1
    rmg1 Posts: 3,159 Forumite
    Part of the Furniture 1,000 Posts Name Dropper
    I have a couple of books I can send to you that deal with VBA programming for MS Excel.
    PM me you're e-mail address if you want copies.
    :wall: Flagellation, necrophilia and bestiality - Am I flogging a dead horse? :wall:

    Any posts are my opinion and only that. Please read at your own risk.
  • isofa
    isofa Posts: 6,091 Forumite
    I'd highly recommend "Excel 2000 Power Programming" by John Walkenbach no doubt it's been updated for newer versions, but it is one of the best Excel/VBA books I've used. I've written some complex systems in Excel, and it's a great reference to have beside you.
  • Bought it! Thanksisofa
    Help me to help you :santa2:
  • Plenty to read from your link! blimey.

    While I sort through that does anyone fancy continuing helping me??

    Next problem is I have £0.00 values - perhaps I need the =if(iserror( formula?
    Help me to help you :santa2:
This discussion has been closed.
Meet your Ambassadors

🚀 Getting Started

Hi new member!

Our Getting Started Guide will help you get the most out of the Forum

Categories

  • All Categories
  • 352.1K Banking & Borrowing
  • 253.6K Reduce Debt & Boost Income
  • 454.2K Spending & Discounts
  • 245.1K Work, Benefits & Business
  • 600.7K Mortgages, Homes & Bills
  • 177.5K Life & Family
  • 258.9K Travel & Transport
  • 1.5M Hobbies & Leisure
  • 16.1K Discuss & Feedback
  • 37.6K Read-Only Boards

Is this how you want to be seen?

We see you are using a default avatar. It takes only a few seconds to pick a picture.