#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 24
Default An if question

Hi I have in a row 3 different values that I want to compare with a specific
value on the same row. It looks like below

A B C D
10 20 30 22

If D is higher than B I want it to return B if is lower I want it to return
A. So far so good, this I can do but if it looks like below and b & c are
empty, I cant get it to return, A it just returna a blank.

A B C D
10 22

This is the formula I used.

=IF(S2Z2;Z2;IF(S2Y2;Y2;X2))

I'ts kind of hard to explain what I mean, I hope someone understands my
question :)

/Freddie



  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default An if question

If the values in A B and C will always be in order, then you could use
a formula like this:

=HLOOKUP(D2,A2:C2,1)

This would be equivalent to:

=HLOOKUP(S2,X2:Z2,1)

using the references in your formula.

Hope this helps.

Pete

FreddieP wrote:
Hi I have in a row 3 different values that I want to compare with a specific
value on the same row. It looks like below

A B C D
10 20 30 22

If D is higher than B I want it to return B if is lower I want it to return
A. So far so good, this I can do but if it looks like below and b & c are
empty, I cant get it to return, A it just returna a blank.

A B C D
10 22

This is the formula I used.

=IF(S2Z2;Z2;IF(S2Y2;Y2;X2))

I'ts kind of hard to explain what I mean, I hope someone understands my
question :)

/Freddie


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 24
Default An if question

Hi Pete, I'm afraid it doesn't do the job. If in the example below the only
data (22) would be would be in column b instead it doesn't work.

Do you have another exmple?

/Freddie

"Pete_UK" wrote:

If the values in A B and C will always be in order, then you could use
a formula like this:

=HLOOKUP(D2,A2:C2,1)

This would be equivalent to:

=HLOOKUP(S2,X2:Z2,1)

using the references in your formula.

Hope this helps.

Pete

FreddieP wrote:
Hi I have in a row 3 different values that I want to compare with a specific
value on the same row. It looks like below

A B C D
10 20 30 22

If D is higher than B I want it to return B if is lower I want it to return
A. So far so good, this I can do but if it looks like below and b & c are
empty, I cant get it to return, A it just returna a blank.

A B C D
10 22

This is the formula I used.

=IF(S2Z2;Z2;IF(S2Y2;Y2;X2))

I'ts kind of hard to explain what I mean, I hope someone understands my
question :)

/Freddie



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Possibly a loaded question, but I think mileslit Excel Discussion (Misc queries) 1 September 10th 05 01:18 AM
How do I find and replace a question mark in Excel? Ranpalandil Excel Discussion (Misc queries) 1 September 7th 05 10:20 PM
Newbie With A Question Michael Excel Worksheet Functions 0 July 28th 05 11:50 PM
Anybody Help with previous question Anthony Excel Discussion (Misc queries) 1 July 26th 05 01:26 PM
Hints And Tips For New Posters In The Excel Newsgroups Gary Brown Excel Worksheet Functions 0 April 15th 05 05:47 PM


All times are GMT +1. The time now is 03:28 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"