If / And / Or Formula

markmogli

New Member
Joined
Dec 20, 2019
Messages
19
Office Version
  1. 365
Platform
  1. Windows
Hello, I'm after some expert help:

My spreadsheet has some sales forecast / actual data in it. I sell products with a fluctuating price based on demand.

A1 is is the product.

B1 is the 1st price I put a product on sale for.

F1 is the gross profit margin formula.

After a few weeks on sale, the price may be adjusted to reflect demand, either up or down.

C1 is the second price the product is priced at. I now need F1 to update the GP on the new selling price.

I may change the price a 2nd time, entering the new price into D1. I now need F1 to update the GP based on the new selling price.

I may change the price a 3rd and final time, entering the new price into E1, I now need F1 to update the GP on the new selling price.

It's driving me bat $%^& crazy - I've tried various IF / AND / AND/OR and I'm getting bogged down in nestled IF's which may be the wrong route....?

Argh!
 
Hey Joe,

Your proposed formula still relies on data being removed from one of the 3 price cells to work.

I have a convoluted formula in my head and would like a shortened, easy version of this formula to go in column G: if E4 and F4 are empty, use D4 for the margin formula, if F4 is empty and D4 contains data, look in E4, if D4 and E4 contain data, use F4.

The margin is calculated based on the fixed cost of the item and sale price, I'd like a dynamic way to look at the changing price.
 
Upvote 0

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Your proposed formula still relies on data being removed from one of the 3 price cells to work.
No, it doesn't.
Is the issue possibly that your cells are not really blank, but contain something like a single space in them?

Can you provide an example to show exactly in what situation it does NOT work?
 
Upvote 0
No, it doesn't.
Is the issue possibly that your cells are not really blank, but contain something like a single space in them?

Can you provide an example to show exactly in what situation it does NOT work?

Here is where I have manually told the formulas in column G to look. Cells E4, E5 & F5 are completely empty.

Book2.xlsx
BCDEFG
230-Nov01-Dec02-Dec
3CostPrice 1Price 2Price 3GP
4Item 1£1.00£10.0090%
5Item 1£1.00£10.00£12.0092%
6Item 1£1.00£10.00£12.00£15.0093%
Sheet1
Cell Formulas
RangeFormula
G4G4=(D4-C4)/D4
G5G5=(E5-C5)/E5
G6G6=(F6-C6)/F6



I must be doing something wrong with the formula?

Book1.xlsx
BCDEFG
230-Nov01-Dec02-Dec
3CostPrice 1Price 2Price 3GP
4Item 1£1.00£10.0090%
5Item 1£1.00£10.00£12.0090%
6Item 1£1.00£10.00£12.00£15.0090%
Sheet3
Cell Formulas
RangeFormula
G4:G6G4=IF(D4<>"",(D4-C4)/D4,IF(E4<>"",(E4-C4)/E4,(F4-C4)/F4))
 
Upvote 0
OK, it looks like you changed some of your column references around (from your original question), and did not adjust the formula properly.
This should do what you want, based on your formula.
Place in cell G4 and copy formula down to cells G5 and G6.
Excel Formula:
=IF(F4<>"",(F4-C4)/F4,IF(E4<>"",(E4-C4)/E4,(D4-C4)/D4))
 
Upvote 0
Solution
OK, it looks like you changed some of your column references around (from your original question), and did not adjust the formula properly.
This should do what you want, based on your formula.
Place in cell G4 and copy formula down to cells G5 and G6.
Excel Formula:
=IF(F4<>"",(F4-C4)/F4,IF(E4<>"",(E4-C4)/E4,(D4-C4)/D4))

Ahhhh! Yes, I see, it's looking at the last price first and then working backwards to the first price.

Winner!

Ta Joe, big hugs and kisses xx :)
 
Upvote 0

Forum statistics

Threads
1,214,599
Messages
6,120,447
Members
448,966
Latest member
DannyC96

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top