Formula help

Weefergie56

New Member
Joined
Jan 26, 2024
Messages
10
Office Version
  1. 365
Platform
  1. Windows
Hello, I am trying to create an excel timesheet and overcome some bits myself but stumped on this formula.



I have a row with the days of the week and hours per day in the row directly underneath . What I am trying to do is have a cell in the spreadsheet check if the day in a cell matches a day in the index row to insert the hours per day in the cell underneath the index row into that cell. These are not the exact cell and rows I have but I am trying to make it easier to read.



A1:G1 (Mon - Sun)

A2:G2 (Hours per day)

A4 (contains the day of the week - ie Wed)

A5 (I want the formula to check what day A4 matches in A1:G1 and insert the hours of work from the cell below that day in row A2 into cell A5)



ABCDEFG
A1MonTueWedThurFriSatSun
A2
8​
8​
12​
8​
8​
0​
0​
A3
A4WedThurFriSatSunMonTue
A5
12​


I have tried these formulas below in A5:



I have tried using an If function but it is pulling info from cells that it shouldn't in row A3:

=IF(A4="true",A1:G1,(MATCH(A5,A2:G2)))



I have also tried using an index function and played about with the colum and row value but getting a are reference error:

=INDEX(A1:G7,MATCH(A4,A1:G7,0),2)



I think my problem is that I found it from an example matching column info rather than rows.



Any advice appreciated. Thank you!
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
=INDEX(A1:G7,MATCH(A4,A1:G7,0),2)
try
=INDEX($A$2:$G$2,MATCH(A4,$A$1:$G$1,0))
copy across

Book12
ABCDEFG
1MonTueWedThurFriSatSun
288128800
3
4WedThurFriSatSunMonTue
512880088
Sheet1
Cell Formulas
RangeFormula
A5:G5A5=INDEX($A$2:$G$2,MATCH(A4,$A$1:$G$1,0))
 
Upvote 0
Solution
How about
Fluff.xlsm
ABCDEFG
1MonTueWedThurFriSatSun
288128800
3
4WedThurFriSatSunMonTue
512880088
Data
Cell Formulas
RangeFormula
A5:G5A5=XLOOKUP(A4,$A$1:$G$1,$A$2:$G$2,"")
 
Upvote 0
Both solutions work perfectly! thank you so much, I owe you both a coffee :coffee:

I appreciate your speedy response too, I've been headscratching this for a while this morning.
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,162
Members
453,021
Latest member
Justyna P

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