Array formula based on 2 criterias

forest1959

New Member
Joined
Mar 16, 2010
Messages
30
Office Version
  1. 2016
Platform
  1. Windows
Hi All

I know this will be pretty straight forward, but i'm struggling to ask the web the right question..

I have an array formula that brings back an "order number" in column E, based on the order date in column A

{=IF(ROWS(A$35:A35)>COUNTIF(Timesheets!$A2:$A2000,$E$31),"",INDEX(Timesheets!$E2:$E2000,SMALL(IF(Timesheets!$A2:$A2000=$E$31,ROW(Timesheets!$A2:$A2000)-ROW(Timesheets!$A$2)+1),ROWS(A$35:A35))))}

I just need to add another criteria based on the employee's name populated in column C

Below is an example of the results i'm looking for

Criteria 1Criteria 2Results
05/04/2019Brian3456
5678
31/03/2019Brian1234
31/03/2019Chris2345
05/04/2019Brian3456
05/04/2019Chris4567
05/04/2019Brian5678
05/04/2019Chris6789

<colgroup><col><col span="2"><col><col span="2"></colgroup><tbody>
</tbody>

regards
Paul
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Hi,

Could you test following .

Code:
=IF(ROWS(A$35:A35)>COUNTIF(Timesheets!$A2:$A2000,$E$31),"",INDEX(Timesheets!$E2:$E2000,SMALL(IF(Timesheets!$A2:$A2000=$E$31,IF(Timesheets!$C2:$C$2000=$F$31,ROW(Timesheets!$A2:$A2000)-ROW(Timesheets!$A$2)+1),ROWS(A$35:A35)))))

HTH
 
Upvote 0
Thank you, it comes with an error saying i've entered too few arguments for this function
 
Upvote 0
Where exactly is Brian ... your new value for your new criteria ... ???

My guess was cell F31 ... is that right ?
 
Upvote 0
When i ok the error message the following is visible on the screen

SMALL(array, k)
 
Upvote 0
OK ...

must be a misplaced parenthesis ... somewhere ...

Have a try with

Code:
=IF(ROWS(A$35:A35)>COUNTIF(Timesheets!$A2:$A2000,$E$31),"",INDEX(Timesheets!$E2:$E2000,SMALL(IF(Timesheets!$A2:$A2000=$E$31,IF(Timesheets!$C2:$C$2000=$F$31,ROW(Timesheets!$A2:$A2000)-ROW(Timesheets!$A$2)+1)),ROWS(A$35:A35))))

HTH
 
Last edited:
Upvote 0
OK ...

must be a misplaced parenthesis ... somewhere ...

Have a try with





Code:
=IF(ROWS(A$35:A35)>COUNTIF(Timesheets!$A2:$A2000,$E$31),"",INDEX(Timesheets!$E2:$E2000,SMALL(IF(Timesheets!$A2:$A2000=$E$31,IF(Timesheets!$C2:$C$2000=$F$31,ROW(Timesheets!$A2:$A2000)-ROW(Timesheets!$A$2)+1)),ROWS(A$35:A35))))

HTH

Almost, it brings back the first order number as it should, but then brings back every second rowed order number below it

so for example order numbers
1 Chris
2 Brian
3 Brian
4 Chris
5 Brian

and so on

where 2 is Brians first order number, its bringing back 2, but then 4, 6, 8 etc
 
Upvote 0
Well testing an array formula ... without the underlying data ... is always tricky ...

What about :

Code:
=IF(ROWS(A$35:A35)>COUNTIF(Timesheets!$A2:$A2000,$E$31),"",INDEX(Timesheets!$E2:$E2000,SMALL(IF(Timesheets!$C2:$C$2000=$F$31,IF(Timesheets!$A2:$A2000=$E$31,ROW(Timesheets!$A2:$A2000)-ROW(Timesheets!$A$2)+1)),ROWS(A$35:A35))))
 
Upvote 0
Well testing an array formula ... without the underlying data ... is always tricky ...

What about :

Code:
=IF(ROWS(A$35:A35)>COUNTIF(Timesheets!$A2:$A2000,$E$31),"",INDEX(Timesheets!$E2:$E2000,SMALL(IF(Timesheets!$C2:$C$2000=$F$31,IF(Timesheets!$A2:$A2000=$E$31,ROW(Timesheets!$A2:$A2000)-ROW(Timesheets!$A$2)+1)),ROWS(A$35:A35))))


I really appreciate your persistence. in the same example as above, this time it's bringing the 2 back (as it should), but nothing thereafter
 
Upvote 0

Forum statistics

Threads
1,215,187
Messages
6,123,540
Members
449,107
Latest member
caya

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top