×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

if statement calculation base on a list of words

if statement calculation base on a list of words

if statement calculation base on a list of words

(OP)
Hi all, I need some help. I am trying to automate a BOM creation task. We have three columns, extended qty, actual qty, and description. I also have a list of hardware that details how many extra get put in hardware bags based on a type. I would like to create a nested if statement that will add the correct extra qty to the extra qty column based on what word the description cell starts with.

Any ideas?

Kind Regards,

Brian

RE: if statement calculation base on a list of words

Use a table and VLookup to get the extra quantity.

Your table should look like this:

Actual	Bolts	Screws
1	0	0
5	1	1
15	1	2
20	2	2
30	3	2
40	4	2

 

Use the IF to determine which column of the table to use.

Use Contains()

Use Or()

RE: if statement calculation base on a list of words

(OP)
I need a way for excel to pick the correct formula based on the first word in the description.

Kind Regards,

Brian

RE: if statement calculation base on a list of words

If you really want help...

1) state your requirements, clearly concisely and completely

2) upload a representative workbook, rather than a nearly worthless picture

Skip,

glassesJust traded in my OLD subtlety...
for a NUance!tongue

RE: if statement calculation base on a list of words

(OP)
SkipVought, read my OP. I believe I stated my needs quite clearly. As for the pictures, the cell with the formula is selected so the formula shows in the formula bar. Just to appease the masses, I am attaching a mock BOM.

In the future, I would be best, if the OP does not give you the information, request it without being a complete ass. JUST SAYIN. Or, just move on.

RE: if statement calculation base on a list of words

BLong - Have you tried the "Indirect" function. Look for videos on youtube. The indirect function combined with lookup tables can be very helpful in situations like this.

User makes an initial selection from a drop down, or they enter a selection. Then the indirect function allows you to look up additional values based on the initial selection.

RE: if statement calculation base on a list of words

Sorry, there are no IFs in this solution.

Here's your workbook back with these additions:

1) a consolidated lookup table
2) lookup range names
3) a new consolidated lookup formula

B4: =INDEX(OFFSET(Item,MATCH(LEFT(E4,FIND(" ",E4)-1),Item,0)-1,2,COUNTIF(Item,LEFT(E4,FIND(" ",E4)-1)),1),MATCH(C4,OFFSET(Item,MATCH(LEFT(E4,FIND(" ",E4)-1),Item,0)-1,1,COUNTIF(Item,LEFT(E4,FIND(" ",E4)-1)),1),1),1)+C4



Skip,

glassesJust traded in my OLD subtlety...
for a NUance!tongue

RE: if statement calculation base on a list of words

(OP)
Skip,
The only issue I have with your solution, it removes the cell borders once the formula completes the calculation. Is there any way to stop that? I know that its easy enough to go in a put the borders back in, but when you are dealing with a BOM that has several hundred components, it would be nice if it was complete when the information is copy & pasted.

Kind Regards,

Brian

RE: if statement calculation base on a list of words

(OP)
Never mind, I figured it out with conditional formatting. Thanks all for looking.

RE: if statement calculation base on a list of words

Quote:

The only issue I have with your solution, it removes the cell borders once the formula completes the calculation.

A formula alone, cannot change formatting. COPYING a cell that contains a formula and PASTING it in a cell with some other format than the source cell, will, indeed, change the format of the target cell.

In order to avoid "infecting" the target cell's format, use Paste Special--FORMULAS.
Conditional Formatting would have nothing to do with pasting formulas.

Skip,

glassesJust traded in my OLD subtlety...
for a NUance!tongue

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members! Already a Member? Login


Resources

Low-Volume Rapid Injection Molding With 3D Printed Molds
Learn methods and guidelines for using stereolithography (SLA) 3D printed molds in the injection molding process to lower costs and lead time. Discover how this hybrid manufacturing process enables on-demand mold fabrication to quickly produce small batches of thermoplastic parts. Download Now
Design for Additive Manufacturing (DfAM)
Examine how the principles of DfAM upend many of the long-standing rules around manufacturability - allowing engineers and designers to place a part’s function at the center of their design considerations. Download Now
Taking Control of Engineering Documents
This ebook covers tips for creating and managing workflows, security best practices and protection of intellectual property, Cloud vs. on-premise software solutions, CAD file management, compliance, and more. Download Now

Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close