Formula for IF a cell contains value

T

texansgal

I am in the process (still) of making a Bill of Lading in Excel that
transfers data onto the Packing List (our program at work is horrible). I
have a total of 8 sheets. The 1st Tab (PL) feeds to Tabs 2-4 (BOL pages 1-3).
Then Tab 5 (PL-pg2) feeds to Tabs 6-8 (BOL pages 4-6). I did it this way
since I am not an expert on Excel (as I am sure there was a much easier way).
I can fit 18 line items on the Packing List however the Bill of Ladings can
only fit 6 line items (which is why there are 3 pages for the BOL's).

Each page as a total weight for that page. I want the last page to have the
total weight for all pages.

The problem that comes in for me (not knowing formula's that well) is that
we do not always print all pages when there is no data on them. For example:
We only have 5 items so we only need the 1st BOL page. That is EASY, we have
the total of Page 1 on that page... Then say we have 10 items, I could have
the total of both pages on Page 2... easy again! BUT we might have 18 items.
Each page has the total (and Page 2 will have the total for pages 1 and 2 but
not page 3) and it is easy to just total the 3 pages and hand write it on the
3rd page. That looks crappy to me...

So how in the world would I write the formula for the TOTAL of all 3 pages
to show up on the 3rd page only if there are that many items and for it to
NOT show up on the 2nd page (which would show the total of pages 1 and 2) is
there is a 3rd page? I would also have to put a formula in on page 2 where I
would normally have the total if there were only 2 pages.

Example:

PL has 17 line items which will have the total weight from BOL - pg1 in cell
V49 (which it the total for V42:Z47). Then it will have the total weight from
BOL - pg2 in cell V49 (which is the total for V42:Z47). Then the total weight
from BOL - pg3 in cell V49 (which is the total for V42:Z47). Page 2 will have
the total of pages 1 and 2 (but I do not want it to show here because there
IS a page 3). I do want the total of pages 1, 2 and 3 to ONLY show up on the
3rd page in cell V50.

I sure hope this makes sense... I am still trying to get rid of the ZERO's
when I have the info going from PL to BOL's and there is nothing in that
particular cell. UGH!

Thank you and I sure hope this makes sense.
 
B

Bob Bridges

It SORT OF makes sense; it's clear to me you want an IF function, or two or
three of them. Maybe just looking up the IF worksheet function will tell you
what you want.

Basically the IF function says something like this: "If X is true, then use
this value; otherwise, use that value". For example, say you want a big,
glaring red message in E2 if D2 is greater than 100, but blank otherwise.
Easy: Set the format for E2 to be big, glaring red, and then in E2 put
=IF(D2>100,">100 not allowed!","").

How to apply that to your situation? Well, it depends on how you can tell
there's data on page 2. If a certain cell on page 2 equals "" if there's no
data, then you can use the IF function to say "IF(that cell is ""},"",total
for pages 1 and 2). Those aren't real values, you understand, because I
don't know how you'd calculate that total or which cell you need to check,
but that's the general way I'd go about it.

If you need me to get more specific, then you need to get more specific
first: You kept talking about "page 2" but never said whether you meant PL2
or BOL2, so I couldn't follow the narrative very exactly. But maybe this is
enough of a hint.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top