2

I'm working with an activity log of orders. My goal is to find the number of orders that were denied, then eventually released. A order was denied if the remark starts with "D", any other remark is a release.

If Remark starts with "D" Match order # in Table with Date greater than Date of "D" remark, return date of release.

This is the formula I'm using but I'm missing the date logic, it is returning the first order # match.

=SUM(IF(LEFT(C13,1)="D",INDEX($A$2:$E$2305,MATCH(E13,$E$2:$E$2305,0),4),1))

enter image description here

2
  • FWIW: The sum is not needed, as far as I can tell. You should get the same answer without it. Commented May 5, 2017 at 13:45
  • So what should the result be? Commented May 5, 2017 at 13:48

2 Answers 2

1

If the eventual release date will always be below the denied then setting the index match to start from the next row should fix it. With an image I cannot cut and paste the data to check.

for the row highlighted:

=IF(LEFT(C13,1)="D",INDEX(A14:$E$2305,MATCH(E13,E14:$E$2305,0),4),1)

This does assume that the denial will happen only once.

Sign up to request clarification or add additional context in comments.

Comments

0

If your data is not always sorted on ascending date, use this array formula:

=IF(LEFT(C13,1)="D",INDEX($D$2:$D$2305,MATCH(1,(E13=$E$2:$E$2305)*(D13<$D$2:$D$2305),0)),1)

Being an array formula it must be confirmed with Ctrl-Shift-Enter instead of Enter when exiting edit mode. If done correctly then Excel will put {} around the formula.

This formula will show an error if no matches are found, the order was never released to deal with that error we can do this:

=IF(LEFT(C13,1)="D",IFERROR(INDEX($D$2:$D$2305,MATCH(1,(E13=$E$2:$E$2305)*(D13<$D$2:$D$2305),0)),"Not Released"),1)

Now if the order was never released then you will get Not Released You can change that to anything you want.

8 Comments

Thank you Scott. It is not always in ascending order. The formula should be pulling the date of the release. I think this formula is close but it is still saying not released when the release is right below it. Maybe another piece of logic needs to be added Remark does not start with D?
Did you enter the formula with Ctrl-Shift-Enter?
I did, it's saying "not released".
Also this formula was designed based on yours, it is to be entered first into row 13. then copy/dragged up and down. What is the formula in F2?
My bad, I had the > wrong should be <. See edit @HannahSawyer
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.