Solved

Autofill Invoice Tasks in Excel using Index/Match

Posted on 2016-07-15
7
79 Views
Last Modified: 2016-07-27
Hello Experts!

I'm so close to a solution.  It is probably an easy fix - I've just hit coding writer's block.  

I created a spreadsheet that when the user changes the invoice number, it automagically populates the list of tasks used in that invoice period with this array formula:
{=IFERROR(INDEX(Task!$B$6:$B$11,SMALL(IF(LEN(Task!$D$6:$D$11)>0,ROW(Task!$A$6:$A$11)-ROW(Task!$A$5)),ROW(Task!1:1)),MATCH($C$3,Task!$C$1:$H$1,0)),"")}

Open in new window

It works great on Invoice 1, but when I switch to Invoice 2, it doesn't work.  I know why.  This part of the code (Task!$D$6:$D$11) needs to vary when I change from Invoice 1 to 2 or 3.  I could do a switch formula, but I'm hoping there is a more elegant solution.  Maybe nesting another match formula?  Here's where I need your help!

I have attached the file to help you visualize what I'm doing.  Any help is appreciated!
Invoices.xlsx
0
Comment
Question by:TechNinja2
  • 4
  • 3
7 Comments
 
LVL 29

Accepted Solution

by:
Subodh Tiwari (Neeraj) earned 500 total points
ID: 41712991
Try this....
=IFERROR(INDEX(Task!$B$6:$B$11,SMALL(IF(LEN(INDEX(Task!$C$6:$H$11,,MATCH("INVOICE "&$C$3,Task!$C$2:$H$2,0)+1))>0,ROW(Task!$A$6:$A$11)-ROW(Task!$A$5)),ROW(Task!1:1))),"")

Open in new window


For details, refer to the attached.
Invoices.xlsx
1
 

Author Comment

by:TechNinja2
ID: 41717297
Perfect - thank you Subodh!  

I have one more question, I'd like to total cost row.  I know the formula will be similar but it will be somehow matching the invoice number and task number in the Invoice worksheet to get the total cost amounts in ROW 'I' in the Task worksheet (see attached).  Can you help out?
Invoices.xlsx
0
 
LVL 29

Expert Comment

by:Subodh Tiwari (Neeraj)
ID: 41717300
Mock up the desired output on the Invoice sheet and provide a mapping to the Task sheet as well to know what output you are trying to achieve and based on what conditions.
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Author Comment

by:TechNinja2
ID: 41717421
Ok - I think I figured it out.  Here's what I changed (and put it in cell E6 of the first tab/worksheet).  It seems to be pulling the correct totals.  Is this correct?

{=IFERROR(INDEX(Task!$I$6:$I$11,SMALL(IF(LEN(INDEX(Task!$C$6:$H$11,,MATCH("INVOICE "&$C$3,Task!$C$2:$H$2,0)+1))>0,ROW(Task!$A$6:$A$11)-ROW(Task!$A$5)),ROW(Task!1:1))),"")}

Open in new window


Thx!
0
 
LVL 29

Expert Comment

by:Subodh Tiwari (Neeraj)
ID: 41717463
Obviously tt's correct if you are getting the desired output. :)
0
 

Author Closing Comment

by:TechNinja2
ID: 41732197
Occam's razor - I get it - I overthought it.  I wanted to ensure I didn't miss something.  Thx - Great job!
0
 
LVL 29

Expert Comment

by:Subodh Tiwari (Neeraj)
ID: 41732381
Thanks for the feedback. :)
0

Featured Post

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question