Vlookup

matthewlouis

Active Member
Joined
Mar 28, 2014
Messages
374
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Column R18 uses the formula =IFERROR(IF(D18<$H$3,"Failed",""),"")

D = current price

$H$3 is the price I am comparing D18 to. $H$3 is constant, of course

Once the price in Column D becomes LESS THAN the fixed price of $H$3, the cell in R18 says "FAILED." That's great. But when I copy the formula down and the cells in Column D become > than $H$3 again, Column D's price shows up again . . . I don't want that. Once a cell in Column R says "FAILED, I want every Column R cell AFTER that to say "FAILED" regardless if any of the following prices in Column D show up > $H$3 somewhere down the column.

This is messing up my Lookup formula in R4 =IFERROR(VLOOKUP("Failed",$R$6:$R$133,1,FALSE),"") because it's looking up everything AFTER R18 and including it in the Lookup.

Any ideas? Thanks in advance!!
 
Last edited:

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
If I'm understanding you clearly, once a row is found < $H$3, all following rows should fail, even if they become > $H$3.

=IFERROR(if(r17="Failed","Failed",IF(D18<$H$3,"Failed","")),"")

Crystal
 
Last edited:
Upvote 0
Hey Crystal,

Stumped again. The formula you gave me above works great. However, I am on another spreadsheet and I need to use the same formula except I need to us > and not <.

When I enter =IF(AA19="Failed","Failed",IF(B20>$G$3,"Failed","")) I get Failed when B20 is blank. On the other sheet you helped me, this was not a problem. That formula was =IFERROR(IF(R9="Failed","Failed",IF(C22<$G$3,"Failed","")),"") would return a blank, the only difference in these is the column and I am using > and not <

I have no idea. Same formula . . . using > (doesn't work) instead of < (works).

I am stumped! any idea?

Thanks in advance!
 
Last edited:
Upvote 0
When I enter =IF(AA19="Failed","Failed",IF(B20>$G$3,"Failed","")) I get Failed when B20 is blank.
What is in cells AA19 and G3 in this particular example?
 
Last edited:
Upvote 0
B20 and $G$3 are numbers. I copy the formula down so B20 changes and $G$3 (2,520) remains constant.

AA20 is a column that will say Failed if B20 > $G$3. However, B20 is blank . . . so how can B20 be > $G$ and return Failed when there is no number there. It's supposed to return a blank.
 
Last edited:
Upvote 0
B3 and $G$3 are numbers.
I am trying to recreate your exact scenario on my side.
So for any example that is not working for you, please provide me with the exact values in those cells where it is not working for you.
 
Upvote 0
A few other things to note:

If your last reply, you talk about B20 and AA20:
B20 and $G$3 are numbers. I copy the formula down so B20 changes and $G$3 (2,520) remains constant.

AA20 is a column that will say Failed if B20 > $G$3. However, B20 is blank . . . so how can B20 be > $G$ and return Failed when there is no number there. It's supposed to return a blank.

But in your previous reply, your formula is looking at cell AA19, not AA20.
When I enter =IF(AA19="Failed","Failed",IF(B20>$G$3,"Failed","")) I get Failed when B20 is blank.
Are you sure that you have written your formula correctly to look at the correct cells?

One other thing to check to is make sure you are dealing with numbers.
What do the following formulas return?
Code:
=ISNUMBER(B20)
=LEN(B20)
=ISNUMBER(G3)
 
Upvote 0
Solving for cell AA20

=IF(AA19="Failed","Failed",IF(B20>$G$3,"Failed",""))

AA19 is blank

B20 is blank

$G$3 is 266.07

If B20 is blank, I am asking why it's returning Failed in AA20 because how can a blank be > $G$3.

Thanks, Joe, sorry I wasn't more clear.
 
Last edited:
Upvote 0
=IF(AA19="Failed","Failed",IF(B20>$G$3,"Failed",""))

AA19 is blank

B20 is blank

$G$3 is 266.07

If B20 is blank, I am asking why it's returning Failed in AA20 because how can a blank be > $G$3.
OK. I have set up this scenario, and the formula returned nothing for me, as it should.

So, that means that you probably have the following going on:
Either AA19 or B20 is not really blank (contains a blank space or some special character).
This can be confirmed easily by the formula formulas, which should return 0 in both cases:
=LEN(AA19)
=LEN(B20)
If either one returns anything other than 0, it is not really blank.
If that is the case, then where is the value coming from? A formula (if so, what is the formula)? Or copied or imported from an external source (another file, the web, etc)?
 
Upvote 0

Forum statistics

Threads
1,224,827
Messages
6,181,194
Members
453,021
Latest member
pingpong7117

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