Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-31-2017, 11:01 AM
jonnie_rc jonnie_rc is offline Help needed with IF formula with a Vlookup Windows 7 64bit Help needed with IF formula with a Vlookup Office 2010 64bit
Novice
Help needed with IF formula with a Vlookup
 
Join Date: Aug 2017
Posts: 9
jonnie_rc is on a distinguished road
Default Help needed with IF formula with a Vlookup

Hi,

I was looking at doing a formula like the below;

=IF(ISNUMBER(SEARCH(”P”,D19,3)),(VLOOKUP(D19,'Rate s Summary '!A$2:Q$1573,2,0)),D19)

Basically, I have a code "QAPLI0" in cell D19. What i want to do is convert this to a QAR code which is what my Vlookup is for. Only problem is that when i already have a QAR code in the cell D19 it still brings me back a QAP instead of leaving it was whats already in the cell D19 which is what i though i had down as the "value if false" part of the IF statement.

Am i making sense? I tried to use a FIND instead of SEARCH but got the same result. Am i missing something here?

Any help would be great.

Thanks


Jon
Attached Files
File Type: xlsx excel help.xlsx (78.3 KB, 9 views)
Reply With Quote
  #2  
Old 08-31-2017, 11:38 AM
gebobs gebobs is offline Help needed with IF formula with a Vlookup Windows 7 64bit Help needed with IF formula with a Vlookup Office 2010 64bit
Expert
 
Join Date: Mar 2014
Location: Atlanta
Posts: 837
gebobs has a spectacular aura aboutgebobs has a spectacular aura about
Default

The columns in your rates table need to be switched. What you are searching for, the QAR code, should be in the leftmost column and what you want returned, the QAP code, should be in some column to the right.

What is it you are trying to do here? Correct codes that are incorrectly entered?
Reply With Quote
  #3  
Old 08-31-2017, 11:44 AM
jonnie_rc jonnie_rc is offline Help needed with IF formula with a Vlookup Windows 7 64bit Help needed with IF formula with a Vlookup Office 2010 64bit
Novice
Help needed with IF formula with a Vlookup
 
Join Date: Aug 2017
Posts: 9
jonnie_rc is on a distinguished road
Default

What i am trying to do is conver the QAP code to the QAR code in column 2 in the Rate Summary. However if the reference code is already a QAR code i do not want to change it.

Does that make sense?

This is why i have the logical test on the IF statement referencing the P in the reference cell C5.
Reply With Quote
  #4  
Old 08-31-2017, 11:58 AM
gebobs gebobs is offline Help needed with IF formula with a Vlookup Windows 7 64bit Help needed with IF formula with a Vlookup Office 2010 64bit
Expert
 
Join Date: Mar 2014
Location: Atlanta
Posts: 837
gebobs has a spectacular aura aboutgebobs has a spectacular aura about
Default

=If(Mid(D19,3,1)="P",Left(D19,2) & "R" & Right(D19,3),D19)

If the third character is always either P or R, then the If and Mid are superfluous and you could just use...

=Left(D19,2) & "R" & Right(D19,3)
Reply With Quote
  #5  
Old 08-31-2017, 12:09 PM
jonnie_rc jonnie_rc is offline Help needed with IF formula with a Vlookup Windows 7 64bit Help needed with IF formula with a Vlookup Office 2010 64bit
Novice
Help needed with IF formula with a Vlookup
 
Join Date: Aug 2017
Posts: 9
jonnie_rc is on a distinguished road
Default

Unfortunately i cannot do that. I have hundreds of different old paycodes to convert, hence the lookup. The 2nd and 3rd letters change and are not just A, P or R. Its only the 3rd letters that reference a "P" i need to convert.

So what i am reying to say is;

If the ref cell contains a P in the 3rd position vse the lookup. If not, just stick with the existing reference cell.

So i added another code for reference sake.

Thanks,
Jon
Attached Files
File Type: xlsx excel help.xlsx (78.4 KB, 6 views)
Reply With Quote
  #6  
Old 08-31-2017, 12:57 PM
gebobs gebobs is offline Help needed with IF formula with a Vlookup Windows 7 64bit Help needed with IF formula with a Vlookup Office 2010 64bit
Expert
 
Join Date: Mar 2014
Location: Atlanta
Posts: 837
gebobs has a spectacular aura aboutgebobs has a spectacular aura about
Default

Quote:
Originally Posted by jonnie_rc View Post
Unfortunately i cannot do that. I have hundreds of different old paycodes to convert, hence the lookup. The 2nd and 3rd letters change and are not just A, P or R. Its only the 3rd letters that reference a "P" i need to convert.

So what i am reying to say is;

If the ref cell contains a P in the 3rd position vse the lookup. If not, just stick with the existing reference cell.
In that case, my first formula should work unless I'm missing something.

=If(Mid(D19,3,1)="P",Left(D19,2) & "R" & Right(D19,3),D19)

To whit, if the third character is P, then use the first two original characters, and R, and the last three characters i.e. only change the third character to R if it originally P.

No lookup needed. Simple replacement schema.
Reply With Quote
  #7  
Old 08-31-2017, 01:27 PM
jonnie_rc jonnie_rc is offline Help needed with IF formula with a Vlookup Windows 7 64bit Help needed with IF formula with a Vlookup Office 2010 64bit
Novice
Help needed with IF formula with a Vlookup
 
Join Date: Aug 2017
Posts: 9
jonnie_rc is on a distinguished road
Default

Ok great. I have run that and got all the right results.

Really appreciate your help on this.

Thanks Gebobs.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help needed with IF formula with a Vlookup Possible to use an existing vlookup formula to also insert correct info and trigger a SUM formula innkeeper9 Excel 2 09-13-2016 08:59 PM
Help needed with IF formula with a Vlookup VLOOKUP Formula? ekeithjohnson Excel 6 08-28-2014 01:16 PM
Help needed with IF formula with a Vlookup Vlookup formula teza2k06 Excel 2 03-18-2014 01:21 PM
Help needed with IF formula with a Vlookup I think I need an IF/AND & VLOOKUP formula here Catbert Excel 18 08-25-2013 07:38 PM
IF + VLOOKUP formula help skyline255 Excel 0 09-19-2012 05:05 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:43 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft