Very complicated VLOOKUP

Tricks420

New Member
Joined
Dec 6, 2023
Messages
6
Office Version
  1. 365
Platform
  1. Windows
Hello,

I have a complicated question I have been trying to figure out for hours. I would like a formula for O4 that will look in Column C for the date in N4. Then when it finds it it references the Grow Room number that it was found in, which is located in Column B.
 

Attachments

  • Screenshot (151).png
    Screenshot (151).png
    71.2 KB · Views: 17
I believe pointing them to a function that would likely work for them is helpful. You do not. We do not have to agree.
 
Upvote 0

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Perhaps something like this:

Excel Formula:
=XLOOKUP(N4,$C$4:$C$10,$B$4:$B$10,"")

Be sure to adjust the ranges to fit your data.

Hello thank you for your reply however I am getting back "Unpinched" instead of Grow Room 2. Also when I try to extend the ranges I get a #VALUE error.
 

Attachments

  • Screenshot (153).png
    Screenshot (153).png
    61.8 KB · Views: 1
Upvote 0
I believe pointing them to a function that would likely work for them is helpful. You do not. We do not have to agree.
I've been working on this for hours and don't understand. It is for work and I need an answer ASAP. This is why I am here and asking.
 
Upvote 0
See if this works for you:

Excel Formula:
=IFNA(INDEX($B$3:$B$13,MATCH(N4,$C$3:$C$13,0)-IF(XLOOKUP(N4,$C$3:$C$13,$B$3:$B$13,"")="Unpinched",1,2)),"")
 
Upvote 0
Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.

Be sure to follow & read the link at the end of the rule too!

Cross posted at: Difficult XLOOKUP question
There is no need to repeat the link(s) provided above but if you have posted the question at other places, please provide links to those as well.

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
 
Upvote 0
I posted this in the cross-posted thread

Excel Formula:
=LET(M,MATCH(N4,$C:$C,0),INDEX($B:$B,M-IF(INDEX($B:$B,M)="Pinched",2,1)))
 
Upvote 0
I believe pointing them to a function that would likely work for them is helpful. You do not. We do not have to agree.
This needs more than simply switching to XLOOKUP, and if the OP knew how to do it, they wouldn't have needed to ask the question. The problem is "find this row, then move up until you get the number."
 
Upvote 0
Hey all, it's starting to work the way I need. I changed some of the tables up and it's working. However I am trying to spread the formula to all the required cell in the bottom table. But when I do so it is changing where to look to retrieve the data. I only need the formula on the lines with the dates, not the lines that say "# of Staff". Does anyone know of a quick way? Thank you. Formula is in cell C55 and needs to spreads to C57, C59, C61, etc.

I am trying to upload the file but I can't seem to find the option other then image.
 

Attachments

  • Screenshot (154).png
    Screenshot (154).png
    51 KB · Views: 6
Upvote 0
it's starting to work the way I need
There are multiple solutions offered. Which formula are you using?

I am trying to upload the file but I can't seem to find the option other then image.
There is no option to upload a file. You can install the XL2BB add-in (click on the icon in the edit controls). That allows you to select a range, then paste it into a post to show data, formulas, formatting, etc. It's not quite as good as having the file but it's the next best thing.

The question you have in your latest post is quite different than your original question and probably needs a different formula.
 
Upvote 0
Formula is in cell C55 and needs to spreads to C57, C59, C61, etc.
Try:
  • Select Cells C55:C56 (2 cells)
  • Ctrl+C (copy)
  • Select an even number of cells to copy 2 eg C57:C68 (multiple of 2)
  • Ctrl+V (paste)
If you wanted the formula every 3 rows you would select 3 cells and then your "copy to" range would be a multiple of 3.

Alternatively if you use Jeff's @6StringJazzer formula just change it to ignore the # of Staff rows so that you can copy it to every row but still only get the results on the rows you want it on.

Rich (BB code):
=LET(M,MATCH(N4,$C:$C,0),IF(M4="# of Staff","",INDEX($B:$B,M-IF(INDEX($B:$B,M)="Pinched",2,1))))
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,110
Messages
6,123,146
Members
449,098
Latest member
Doanvanhieu

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