Solved

excel formula or VBA

Posted on 2016-10-05
7
52 Views
Last Modified: 2016-10-06
I have two Columns in EXCEL

below are the scenarios i have to cover in the formula
  1. IF I have data in Col A that have to updated in Column D
  2. If I have Zero in Column A then do a vlookup based on Column C in Sheet2 and pick update results of column 5
  3. even after vlookup if i do not find anything Column D have to be updated with Column B
  4. in Column A if i have the rows contain FUSE DB then col B have to picked
  5. Delete Fuse db word in results column

I know this is little confusing I am attaching a sample file
How can i have formula or macro to do everythin in one column
sample1.xlsx
0
Comment
Question by:Nirvana
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 23

Expert Comment

by:NBVC
ID: 41830021
Try in column A:

=IFERROR(VLOOKUP(C2,Sheet2!$A$2:$E$6,5,0),B2)

copied down.

I think you are also talking about the formula in column D.  It looks like you had and \ in the formula causing error:

s/b =IF(A2="FUSE DB",B2,A2)

Does this cover your request?
0
 

Author Comment

by:Nirvana
ID: 41830313
Thank you so much, just few changes

1. If i get a result as "Fuse DB" in Col "D" then it have to be treated as blank

which means after execute the below formula and if stil get "Fuse DB" it have to cosider ""(Blank)

=IFERROR(VLOOKUP(C2,Sheet2!$A$2:$E$6,5,0),A2)

2. If my Column "D' is zero and Column Has "Fuse DB" only then this Formula if I have data in Columd then Col E have to be blank

=IF(A2="FUSE DB",B2,A2)

In a nut shell i either have to have data in Col D or Col E
0
 
LVL 23

Expert Comment

by:NBVC
ID: 41830396
For part 1, try

=IF(VLOOKUP(C2,Sheet2!$A$2:$E$6,5,0)="Fuse DB","",IFERROR(VLOOKUP(C2,Sheet2!$A$2:$E$6,5,0),A2)

for part 2, our description got a little confusing...  can you elaborate on that.

I did notice that the 0 in column A is text, so the current formula in column C should have the 0 in quotes...

=IF(A2="0",C2,A2)  

copied down.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Nirvana
ID: 41830432
for part 1 i am getting an error and i have attached file with changes highlighted in red. Hope I am clear. Thank you so much for your time
sample1.xlsx
0
 
LVL 23

Accepted Solution

by:
NBVC earned 500 total points
ID: 41830463
Try:

=IFERROR(IF(VLOOKUP(C2,Sheet2!$A$2:$E$6,5,0)="Fuse DB","",VLOOKUP(C2,Sheet2!$A$2:$E$6,5,0)),A2)
1
 
LVL 23

Expert Comment

by:NBVC
ID: 41830468
and change G2 to:

=IF(A2="FUSE DB",B2,A2) to remove the #NA error
1
 

Author Closing Comment

by:Nirvana
ID: 41831356
Thank you so much. is there any way i can put it as a macro formula gets copy pasted based on the active cells in Col A?
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question