+ Reply to Thread
Results 1 to 3 of 3

Formula Coding Problem

  1. #1
    Insomniac53
    Guest

    Formula Coding Problem

    Can anyone help with this coding problem please? I am using the Name Manager to calculate an Order Total which is the number of items ordered times the cost of each item. The code has to look up columns in one sheet to find the number of items ordered then the respective row in another sheet to find the cost of that item, multiply the two together and then repeat for all items and calculate the total cost. The code looks like this:
    =SUM('Sales Record'!$B68*Item!XFA3,'Sales Record'!$C8*Item!XFA4,')

    etc etc. This is okay for a few items but not for many. Can anyone suggest a neat way of compacting this with code, perhaps some kind of loop, that will cater for larger numbers of items in each order? Hope that makes sense.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Formula Coding Problem

    Do you mean B68 & C8 or should C8 be C68 ?

  3. #3
    Insomniac53
    Guest

    Re: Formula Coding Problem

    Donkey Ote, I could not reply to your question as I was blocked from posting for some reason, I think due to an email confirmation error. Apologies if you thought I was ignoring the response. Anyway, I've sorted the problem with this code:
    =SUM(ArraySales)*(ArrayBookPrices)

    where the named arrays represent...well, the named arrays! I don't use Excel regularly so this was a fast and tricky learning curve. And yes, I made a mistake in the first post. Well spotted. Thanks for replying so quickly.

+ 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