Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 71
Default If/then and Vlookup formula

Hi all!

What I am trying to do:
In Sheet 1, column A, I have a list of account numbers. In Sheet 2, Column
A, I have another list of account numbers. If an account in Sheet 1 column
A, is also in Sheet 2, column A, then the account is budgeted; If an account
in Sheet 1 column A is not in Sheet 2, column A, then the account is not
budgeted.

I'm not the cleverest with the formulas, and this is what I have tried and
am not getting the best results:
=IF(A2=(VLOOKUP(A2,Sheet2!$A$2:$B$1072,1,FALSE))," Budgeted","Acct Not
Budgeted")

It is working for accounts that are budgeted, but for accounts that aren't
budgeted, I'm getting #N/A. I assume this has something to do with the
VLookup.

Any help as to where I'm going wrong would be greatly appreciated. Thank you.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 12
Default If/then and Vlookup formula

Yes. The Vlookup is not finding the lookup value in the specified
range (as you are expecting) and therefore giving a #N/A error. Just
stick an isnumber around a match function. Here's a similar formula.

=if(isnumber(match(A2,Sheet2!$A$2:$B$1072,0)),"Bud geted","Not
Budgeted")

On Mar 12, 2:00 pm, Ashley wrote:
Hi all!

What I am trying to do:
In Sheet 1, column A, I have a list of account numbers. In Sheet 2, Column
A, I have another list of account numbers. If an account in Sheet 1 column
A, is also in Sheet 2, column A, then the account is budgeted; If an account
in Sheet 1 column A is not in Sheet 2, column A, then the account is not
budgeted.

I'm not the cleverest with the formulas, and this is what I have tried and
am not getting the best results:
=IF(A2=(VLOOKUP(A2,Sheet2!$A$2:$B$1072,1,FALSE))," Budgeted","Acct Not
Budgeted")

It is working for accounts that are budgeted, but for accounts that aren't
budgeted, I'm getting #N/A. I assume this has something to do with the
VLookup.

Any help as to where I'm going wrong would be greatly appreciated. Thank you.



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 273
Default If/then and Vlookup formula

Try something like this:

=IF(ISERROR(VLOOKUP(A2,Sheet2!$A$2:$B$1072,1,FALSE ))=TRUE,"Acct Not
Budgeted","Budgeted")

-Chad

"Ashley" wrote:

Hi all!

What I am trying to do:
In Sheet 1, column A, I have a list of account numbers. In Sheet 2, Column
A, I have another list of account numbers. If an account in Sheet 1 column
A, is also in Sheet 2, column A, then the account is budgeted; If an account
in Sheet 1 column A is not in Sheet 2, column A, then the account is not
budgeted.

I'm not the cleverest with the formulas, and this is what I have tried and
am not getting the best results:
=IF(A2=(VLOOKUP(A2,Sheet2!$A$2:$B$1072,1,FALSE))," Budgeted","Acct Not
Budgeted")

It is working for accounts that are budgeted, but for accounts that aren't
budgeted, I'm getting #N/A. I assume this has something to do with the
VLookup.

Any help as to where I'm going wrong would be greatly appreciated. Thank you.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 71
Default If/then and Vlookup formula

Hi Edward. First and foremost, thanks for your help! I tried this formula
and it didn't work properly either. It gave Not Budgeted for all accounts,
including those that were budgeted.

"Edward" wrote:

Yes. The Vlookup is not finding the lookup value in the specified
range (as you are expecting) and therefore giving a #N/A error. Just
stick an isnumber around a match function. Here's a similar formula.

=if(isnumber(match(A2,Sheet2!$A$2:$B$1072,0)),"Bud geted","Not
Budgeted")

On Mar 12, 2:00 pm, Ashley wrote:
Hi all!

What I am trying to do:
In Sheet 1, column A, I have a list of account numbers. In Sheet 2, Column
A, I have another list of account numbers. If an account in Sheet 1 column
A, is also in Sheet 2, column A, then the account is budgeted; If an account
in Sheet 1 column A is not in Sheet 2, column A, then the account is not
budgeted.

I'm not the cleverest with the formulas, and this is what I have tried and
am not getting the best results:
=IF(A2=(VLOOKUP(A2,Sheet2!$A$2:$B$1072,1,FALSE))," Budgeted","Acct Not
Budgeted")

It is working for accounts that are budgeted, but for accounts that aren't
budgeted, I'm getting #N/A. I assume this has something to do with the
VLookup.

Any help as to where I'm going wrong would be greatly appreciated. Thank you.




  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 71
Default If/then and Vlookup formula

Thank you Chad, this worked perfectly!!

I have never seen the ISERROR before, could you review my understanding
below and see if I'm accurate?

I looked up ISERROR in the help section, and my interpretation is that the
VLOOKUP is still finding an exact match, and if not, it will dispaly the
#N/A. By way of the iserror function, if a #N/A would have been displayed,
as it wasn't in the vlookup, for #n/a's, it is now displaying "acct not
budgeted" and for ones that wouldn't have had an #n/a because it was in the
vlookup, the iserror will not be true, so i'm displaying budgeted. (I hope
that makes some kind of sense)

"Chad" wrote:

Try something like this:

=IF(ISERROR(VLOOKUP(A2,Sheet2!$A$2:$B$1072,1,FALSE ))=TRUE,"Acct Not
Budgeted","Budgeted")

-Chad

"Ashley" wrote:

Hi all!

What I am trying to do:
In Sheet 1, column A, I have a list of account numbers. In Sheet 2, Column
A, I have another list of account numbers. If an account in Sheet 1 column
A, is also in Sheet 2, column A, then the account is budgeted; If an account
in Sheet 1 column A is not in Sheet 2, column A, then the account is not
budgeted.

I'm not the cleverest with the formulas, and this is what I have tried and
am not getting the best results:
=IF(A2=(VLOOKUP(A2,Sheet2!$A$2:$B$1072,1,FALSE))," Budgeted","Acct Not
Budgeted")

It is working for accounts that are budgeted, but for accounts that aren't
budgeted, I'm getting #N/A. I assume this has something to do with the
VLookup.

Any help as to where I'm going wrong would be greatly appreciated. Thank you.



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 12
Default If/then and Vlookup formula

Sorry about that...

Change the B to an A in the formula. Should read:

=if(isnumber(match(A2,Sheet2!$A$2:$A$1072,0)),"Bud geted","Not
Budgeted")

Ed

On Mar 12, 2:25 pm, Ashley wrote:
Hi Edward. First and foremost, thanks for your help! I tried this formula
and it didn't work properly either. It gave Not Budgeted for all accounts,
including those that were budgeted.



"Edward" wrote:
Yes. The Vlookup is not finding the lookup value in the specified
range (as you are expecting) and therefore giving a #N/A error. Just
stick an isnumber around a match function. Here's a similar formula.


=if(isnumber(match(A2,Sheet2!$A$2:$B$1072,0)),"Bud geted","Not
Budgeted")


On Mar 12, 2:00 pm, Ashley wrote:
Hi all!


What I am trying to do:
In Sheet 1, column A, I have a list of account numbers. In Sheet 2, Column
A, I have another list of account numbers. If an account in Sheet 1 column
A, is also in Sheet 2, column A, then the account is budgeted; If an account
in Sheet 1 column A is not in Sheet 2, column A, then the account is not
budgeted.


I'm not the cleverest with the formulas, and this is what I have tried and
am not getting the best results:
=IF(A2=(VLOOKUP(A2,Sheet2!$A$2:$B$1072,1,FALSE))," Budgeted","Acct Not
Budgeted")


It is working for accounts that are budgeted, but for accounts that aren't
budgeted, I'm getting #N/A. I assume this has something to do with the
VLookup.


Any help as to where I'm going wrong would be greatly appreciated. Thank you.- Hide quoted text -


- Show quoted text -



  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default If/then and Vlookup formula

Since you're only looking at a single column, it makes more sense to me to use
=match().

=if(isnumber(match(a2,sheet2!$a$2:$a$1072,0)),"Bud geted","Acct not Budgeted")


Ashley wrote:

Hi all!

What I am trying to do:
In Sheet 1, column A, I have a list of account numbers. In Sheet 2, Column
A, I have another list of account numbers. If an account in Sheet 1 column
A, is also in Sheet 2, column A, then the account is budgeted; If an account
in Sheet 1 column A is not in Sheet 2, column A, then the account is not
budgeted.

I'm not the cleverest with the formulas, and this is what I have tried and
am not getting the best results:
=IF(A2=(VLOOKUP(A2,Sheet2!$A$2:$B$1072,1,FALSE))," Budgeted","Acct Not
Budgeted")

It is working for accounts that are budgeted, but for accounts that aren't
budgeted, I'm getting #N/A. I assume this has something to do with the
VLookup.

Any help as to where I'm going wrong would be greatly appreciated. Thank you.


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2002 VLOOKUP formula or other formula Serge Excel Discussion (Misc queries) 4 February 26th 07 04:56 PM
a possible vlookup formula....help changetires Excel Discussion (Misc queries) 0 June 23rd 06 03:05 AM
help with vlookup formula Paula_p New Users to Excel 14 June 2nd 06 03:26 AM
VLookup Formula potsie via OfficeKB.com Excel Discussion (Misc queries) 1 April 24th 06 03:03 AM
Help with vlookup formula sarahp Excel Worksheet Functions 2 September 28th 05 06:21 PM


All times are GMT +1. The time now is 01:05 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"