compare prices in sheet AND HIGHLIGHT lowest and highesr Values then change my price

chiller

New Member
Joined
May 4, 2005
Messages
18
Hi all
I have struggled with this for days, Basically i need to compare competitors prices, and highlight top and bottom values in red and green Respectively..
Then wish to compare MyPrice(F) with Cheapest price(G).

If (F) is Higher then (G)THEN select value IN(G) and reduce the value by 1% round Down to nearest whole figure and paste in NewPrice(I).

If (F) is lower then (G) THEN copy (F) DATA and paste in NewPrice(I) AND
If in any case NewPrice(I) IS lower than Buy Price(H) then highlight cell in red.

First 2 rows as examples
skuComp1Comp2Comp3Comp4MyPriceCheapest priceBuyPriceNewPrice
a70.8174.1678.0170.8132.5070
b72.4972.49789666.5472.4959.0057
c88.0052.0055545552.0020.00
d33.0025.0053255525.0020.00
e98.0078.0021245521.0036.00
f88.0080.0045255525.0025.00
g85.0012.0085835512.0021.00
h68.2168.21528268.2152.0043.10

<tbody>
</tbody>
Thank you
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
You can do your highlighting with Conditional Formatting.

For example, let say that your data range for your Comp prices is B2:E9. To find the minimum for each sku (row) and highlight it, highlight the range B2:E9, then enter this Conditional Formatting formula:
Code:
=B2=MIN($B2:$E2)
then select your formatting color.

Do the same thing for the highest prices, just using MAX instead of MIN.
If in any case NewPrice(I) IS lower than Buy Price(H) then highlight cell in red.

The Conditional Formatting for comparing one cell to another is greater straight forward using Greater Than or Less Than, i.e.
Code:
=I2 < H2

If (F) is Higher then (G)THEN select value IN(G) and reduce the value by 1% round Down to nearest whole figure and paste in NewPrice(I).

If (F) is lower then (G) THEN copy (F) DATA
Place this formula in I2 and copy down:
Code:
=IF(F2 > G2,ROUND(G2*0.99,0),F2)
A few things though:
- you didn't mention what to do if column F equals column G
- based on your rules, your example does not look correct for the second row of data (where is 57 coming from)?
 
Upvote 0
HI
Thank you for your swift response, the data 57 is an error and should have been on the sheet.
- you didn't mention what to do if column F equals column G? as per your formula if the values are the same it in F and G it pastes the same value. this works for me at present.

However i have another question , is their a way to keep all competitor data in their own respective sheet Comp1 (sheet2),Comp2 (sheet3),Comp3 (sheet4),
and have a lookup that matches data sheet1 coloumnA with sheet 2 coloumn A,sheet3 coloumnA AND PULL in the values of columns b out of each sheet in to sheeta.
 
Upvote 0
However i have another question , is their a way to keep all competitor data in their own respective sheet Comp1 (sheet2),Comp2 (sheet3),Comp3 (sheet4),
and have a lookup that matches data sheet1 coloumnA with sheet 2 coloumn A,sheet3 coloumnA AND PULL in the values of columns b out of each sheet in to sheeta.
I'm sure there is, through a set of more complex functions. However, what you are really describing is a Relational Database. As such, I find those sort of projects much easier to do in a Database program, like Microsoft Access (but then again, I use Access quite a bit, so am very familiar with it).

Since I don't really do these sort of things in Excel, I am afraid I cannot really give your guidance on the best way to do that in Excel.
 
Upvote 0
Ok

I have another question : =IF(F4 > G4,ROUND(G4*0.99,0),F4)
can we adjust this formulae to use F4 price if no price in G4
 
Upvote 0
i have another question : =if(f4 > g4,round(g4*0.99,0),f4)
can we adjust this formulae to use f4 price if no price in g4
Rich (BB code):
=if(and(f4 > g4,g4 > 0),round(g4*0.99,0),f4)
 
Upvote 0
Hi there i have taken on board and have started to work in access.
do you have the equivalent expression for

=B2=MIN($B2:$E2)
=IF(F2 > G2,ROUND(G2*0.99,0),F2)
thanks in advance</pre>
 
Upvote 0
Working in Access, your first step is usually to normalize your data tables, to make them easier to work with. There is a link of Relational Databases and Normalization here.

The first issue you would see is that your data table is not normalized. You would not have 4 different "Comp" fields. You would have one Comp Field ID and one Comp Field. So instead of having four comp fields for a record, you would have 4 different records, each with one Comp Field value.

That is important because the MIN function in Access works across multiple records (rows), but only a single field (column). Otherwise, you would need to write a long-winded function comparing each of the four fields with each other (maybe a UDF). Much more painful that it has to be (which is why you want to normalize your data).

The IF function in Access is similar to Excel, except it uses IIF instead of IF.
Code:
[COLOR=#574123]IIF([MyPriceField] > [CheapestPriceField],ROUND([/COLOR][COLOR=#574123][CheapestPriceField][/COLOR][COLOR=#574123]*0.99,0),[/COLOR][COLOR=#574123][MyPriceField][/COLOR][COLOR=#574123])[/COLOR]
 
Upvote 0
I now have 4 tables each with competitor prices in , what code would i use to pull up data for all 4 tables and then apply the min max function
 
Upvote 0

Forum statistics

Threads
1,215,022
Messages
6,122,716
Members
449,093
Latest member
Mnur

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