Find a cell in a table, and return the value above

DannyC96

New Member
Joined
Apr 19, 2024
Messages
2
Office Version
  1. 2011
Platform
  1. Windows
So I'm trying to return a cell value from a table, relating to a text based cell as the searching tool. It's actually part of a larger formula, but the rest is straight forward.

I am trying to return a result where if the day of the week changes in A2, it changes what cell I use in a formula in C2. So in this example, I am adding C6 (Tuesdays total) to B2 (Wednesdays so far). However, what I want to do is if I change the value of A2 to Thursday, then it automatically changes C6 to C7 in the formula in C2.

So I've used VLookups, but not sure how to vlookup for, say, Wednesday, but return the Tuesday total in C6 for the formula to work.


ABC
1TodayPeople Today So FarExpected Total People
2Wednesday5FORMULA
3
4DaysRegular PeopleTotal People
5Monday22
6Tuesday68
7Wednesday715
8Thursday419
9Friday321
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
I expect there will be more to it than this but let's start with this:

Book2
ABCD
11TodayPeople Today So FarExpected Total People
22Wednesday513
33
44DaysRegular PeopleTotal People
55Monday22
66Tuesday68
77Wednesday715
88Thursday419
99Friday321
Sheet1
Cell Formulas
RangeFormula
D2D2=C2+IF(B2="Monday",0,INDEX($D$5:$D$9,MATCH($B$2,$B$5:$B$9,0)-1,0))
 
Upvote 1
Solution
I expect there will be more to it than this but let's start with this:

Book2
ABCD
11TodayPeople Today So FarExpected Total People
22Wednesday513
33
44DaysRegular PeopleTotal People
55Monday22
66Tuesday68
77Wednesday715
88Thursday419
99Friday321
Sheet1
Cell Formulas
RangeFormula
D2D2=C2+IF(B2="Monday",0,INDEX($D$5:$D$9,MATCH($B$2,$B$5:$B$9,0)-1,0))
It works! Ideal :)
 
Upvote 0

Forum statistics

Threads
1,223,868
Messages
6,175,082
Members
452,611
Latest member
bls2024

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