MATCH function

hynkal

New Member
Joined
Apr 18, 2022
Messages
2
Office Version
  1. 2021
Platform
  1. Windows
  2. MacOS
Hey everyone,

I am quite new to excel and been trying to find a solution for over a day now.. I guess it's rather an easy problem, however, cannot really understand how to solve it.

Here is a table I have.

ABCDEFG
1100111

My task is to count ones until certain level (in this instance, 3) and return an exact location after certain level is achieved. For example, 0 means that an employee wasn't present at the job whereas 1 - present at the job. We pay salary after employee has been in the job for 3 days. So, I have to write formula which would return a result of 5 (meaning that employee was present on A and B days, absent on C and D days, and on E day arrived to the job and this was the third day of presence).

I was using formula below but it returns N/A, hopefully someone could help me out.

=+MATCH(3,SUM(J7:N7)=3,0)
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
See if this does what you want. I'm not sure with Excel 2021, but you may have to enter the formula as an array which I think is COMMAND+RETURN on a Mac..
Book1
ABCDEFG
11100111
2
35
Sheet1
Cell Formulas
RangeFormula
A3A3=SMALL(IF($A$1:$G$1=1,COLUMN($A$1:$G$1)-COLUMN(INDEX(A1:G1,1,1))+1),3)
 
Upvote 0
Solution
See if this does what you want. I'm not sure with Excel 2021, but you may have to enter the formula as an array which I think is COMMAND+RETURN on a Mac..
Book1
ABCDEFG
11100111
2
35
Sheet1
Cell Formulas
RangeFormula
A3A3=SMALL(IF($A$1:$G$1=1,COLUMN($A$1:$G$1)-COLUMN(INDEX(A1:G1,1,1))+1),3)

Thank you very much, it works perfectly! Have a nice day!
 
Upvote 0
Here is another way that you could consider.

22 04 19.xlsm
ABCDEFG
11100111
2
35
3 days
Cell Formulas
RangeFormula
A3A3=INDEX(FILTER(SEQUENCE(,COLUMNS(A1:G1)),A1:G1=1),3)


BTW, could you have data like these and, if so, what are the expected results?

22 04 19.xlsm
ABCDEFG
10000111
20101000
3 days (2)
 
Upvote 0
Minor point but just realised that the "=1" in my previous formula suggestion is not actually required. :cool:

22 04 19.xlsm
ABCDEFG
11100111
2
35
3 days
Cell Formulas
RangeFormula
A3A3=INDEX(FILTER(SEQUENCE(,COLUMNS(A1:G1)),A1:G1),3)
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,183
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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