ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Comparing 3 numbers (https://www.excelbanter.com/excel-discussion-misc-queries/231172-comparing-3-numbers.html)

[email protected]

Comparing 3 numbers
 
I'm comparing prices at Baker's, Walmart, and Costco. I've got the
item, unit cost, size, and cost per ounce. I know how to make
comparisons between two numbers using a statement such as:

=IF(D3I3,"Bakers","Walmart")

but how do I add Costco to the equation?

Thank you.

Marcelo

Comparing 3 numbers
 

--
regards from Brazil
Thanks in advance for your feedback.
Marcelo

you should use if(and or if(or

hth

" escreveu:

I'm comparing prices at Baker's, Walmart, and Costco. I've got the
item, unit cost, size, and cost per ounce. I know how to make
comparisons between two numbers using a statement such as:

=IF(D3I3,"Bakers","Walmart")

but how do I add Costco to the equation?

Thank you.


Don Guillett

Comparing 3 numbers
 
Looking in the help index search box for MIN or MAX should help.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

wrote in message
...
I'm comparing prices at Baker's, Walmart, and Costco. I've got the
item, unit cost, size, and cost per ounce. I know how to make
comparisons between two numbers using a statement such as:

=IF(D3I3,"Bakers","Walmart")

but how do I add Costco to the equation?

Thank you.



JLatham

Comparing 3 numbers
 
Try a variation of this:
=IF(AND(A2<B2,A2<C2),"Bakers",IF(AND(B2<A2,B2<C2), "Costco","Walmart"))

change references to A2 to the column with Bakers costs in it,
change references to B2 to column with Costco prices, and
change references to C2 to column with Walmart prices.

I believe that'll do the trick for you. Now if all prices are equal - you
will get sent to Walmart - so you might want to rearrange things so that the
closest outlet ends up being the "default when all prices are equal" :-).


" wrote:

I'm comparing prices at Baker's, Walmart, and Costco. I've got the
item, unit cost, size, and cost per ounce. I know how to make
comparisons between two numbers using a statement such as:

=IF(D3I3,"Bakers","Walmart")

but how do I add Costco to the equation?

Thank you.


[email protected][_2_]

Comparing 3 numbers
 
On May 18, 10:33*am, "Don Guillett" wrote:
Looking in the help index search box for MIN or MAX should help.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
wrote in message

...

I'm comparing prices at Baker's, Walmart, and Costco. I've got the
item, unit cost, size, and cost per ounce. I know how to make
comparisons between two numbers using a statement such as:


=IF(D3I3,"Bakers","Walmart")


but how do I add Costco to the equation?


Thank you.


This only returns a number, correct? In other words, =MIN(D3,I3,N3)
will only give a number, not a store name. I'd like to be able to see
the name of the store with the lowest prices.

JLatham

Comparing 3 numbers
 
Actually, the previous formula doesn't always return the proper value (I hate
it when that happens!). But this one would do it for certain - assumes the
missing item is in column O (D = walmart prices, I = baker's and O =
costco's) You can change them around as desired. In the case of 2, or 3,
prices being the same, it will return the first one it encounters.

=IF(MIN(D2,I2,O2)=D2,"Walmart",IF(MIN(D2,I2,O2)=I2 ,"Bakers","Costco"))

" wrote:

I'm comparing prices at Baker's, Walmart, and Costco. I've got the
item, unit cost, size, and cost per ounce. I know how to make
comparisons between two numbers using a statement such as:

=IF(D3I3,"Bakers","Walmart")

but how do I add Costco to the equation?

Thank you.


Roger Govier[_3_]

Comparing 3 numbers
 
Hi

Supposing your store names are in A1:C1 and the values you are comparing are
in A2:C2

=INDEX($A$1:$C$1,MATCH(MIN($A2:$C2),$A2:$C2,0))

--
Regards
Roger Govier

wrote in message
...
On May 18, 10:33 am, "Don Guillett" wrote:
Looking in the help index search box for MIN or MAX should help.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
wrote in message

...

I'm comparing prices at Baker's, Walmart, and Costco. I've got the
item, unit cost, size, and cost per ounce. I know how to make
comparisons between two numbers using a statement such as:


=IF(D3I3,"Bakers","Walmart")


but how do I add Costco to the equation?


Thank you.


This only returns a number, correct? In other words, =MIN(D3,I3,N3)
will only give a number, not a store name. I'd like to be able to see
the name of the store with the lowest prices.



Don Guillett

Comparing 3 numbers
 
This should do it.
=INDEX($1:$1,MATCH(MIN(A2:C2),2:2,0))

a b c d
2 1 4 b
2 4 5 a
5 3 2 c
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

wrote in message
...
On May 18, 10:33 am, "Don Guillett" wrote:
Looking in the help index search box for MIN or MAX should help.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
wrote in message

...

I'm comparing prices at Baker's, Walmart, and Costco. I've got the
item, unit cost, size, and cost per ounce. I know how to make
comparisons between two numbers using a statement such as:


=IF(D3I3,"Bakers","Walmart")


but how do I add Costco to the equation?


Thank you.


This only returns a number, correct? In other words, =MIN(D3,I3,N3)
will only give a number, not a store name. I'd like to be able to see
the name of the store with the lowest prices.


David Biddulph[_2_]

Comparing 3 numbers
 
If you are looking for the maximum, use
=IF(MAX(D3,I3,X3)=D3,"Bakers",IF(MAX(D3,I3,X3)=I3, "Walmart","Costco"))
If you are looking for the minimum, adjust the formula as necessary.
--
David Biddulph

wrote in message
...
I'm comparing prices at Baker's, Walmart, and Costco. I've got the
item, unit cost, size, and cost per ounce. I know how to make
comparisons between two numbers using a statement such as:

=IF(D3I3,"Bakers","Walmart")

but how do I add Costco to the equation?

Thank you.




[email protected][_2_]

Comparing 3 numbers
 
On May 18, 10:49*am, JLatham
wrote:
Try a variation of this:
=IF(AND(A2<B2,A2<C2),"Bakers",IF(AND(B2<A2,B2<C2), "Costco","Walmart"))

change references to A2 to the column with Bakers costs in it,
change references to B2 to column with Costco prices, and
change references to C2 to column with Walmart prices.

I believe that'll do the trick for you. *Now if all prices are equal - you
will get sent to Walmart - so you might want to rearrange things so that the
closest outlet ends up being the "default when all prices are equal" :-).

" wrote:
I'm comparing prices at Baker's, Walmart, and Costco. I've got the
item, unit cost, size, and cost per ounce. I know how to make
comparisons between two numbers using a statement such as:


=IF(D3I3,"Bakers","Walmart")


but how do I add Costco to the equation?


Thank you.


Can you help me read this in English?

=IF(AND(D3<I3,D3<N3),"Walmart",IF(AND
(I3<D3,I3<N3),"Costco","Walmart"))

If D3 is less than I3, and D3 is less than N3, then the answer is
Walmart, but if I3 is less than D3, and I3 is less than N3, then
Costco. But if neither of those two true, then the answer is Walmart.
Is that correct?


JLatham

Comparing 3 numbers
 
You translated it properly - and it works well with 3 unique values, but when
you have 2 that are the same, it can fail. See my other post (and also the
post by David Biddulph) for a method that works correctly in all cases.


" wrote:

On May 18, 10:49 am, JLatham
wrote:
Try a variation of this:
=IF(AND(A2<B2,A2<C2),"Bakers",IF(AND(B2<A2,B2<C2), "Costco","Walmart"))

change references to A2 to the column with Bakers costs in it,
change references to B2 to column with Costco prices, and
change references to C2 to column with Walmart prices.

I believe that'll do the trick for you. Now if all prices are equal - you
will get sent to Walmart - so you might want to rearrange things so that the
closest outlet ends up being the "default when all prices are equal" :-).

" wrote:
I'm comparing prices at Baker's, Walmart, and Costco. I've got the
item, unit cost, size, and cost per ounce. I know how to make
comparisons between two numbers using a statement such as:


=IF(D3I3,"Bakers","Walmart")


but how do I add Costco to the equation?


Thank you.


Can you help me read this in English?

=IF(AND(D3<I3,D3<N3),"Walmart",IF(AND
(I3<D3,I3<N3),"Costco","Walmart"))

If D3 is less than I3, and D3 is less than N3, then the answer is
Walmart, but if I3 is less than D3, and I3 is less than N3, then
Costco. But if neither of those two true, then the answer is Walmart.
Is that correct?




All times are GMT +1. The time now is 05:49 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com