Live Chat & Podcast at 1:00PM Eastern on Sunday!
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
Business Applications
Tag Cloud
access acer asus bios bsod computer crash desktop driver drivers error ethernet excel freeze gaming hard drive hardware hdmi internet laptop malware memory modem monitor motherboard network printer problem ram registry router security slow software sound toshiba trojan ubuntu 11.10 uninstall usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless
Search
Search for:
Tech Support Guy Forums > Software & Hardware > Business Applications >
help needed to compare values with conditional operator

Reply  
Thread Tools
radhaanand's Avatar
Computer Specs
Junior Member with 3 posts.
 
Join Date: Feb 2010
Experience: Beginner
07-Feb-2010, 08:09 AM #1
help needed to compare values with conditional operator
My data table has three columns

Column 1 : type of a component -name given
Column 2 :their size-(data is given in the form of a range)
Column 3 :cost/unit

Eg :
apple <4 50
apple >7 70
pear 5 100

What formula do I use to find the cost of apple the size of which is 8 ?

Regards
etaf's Avatar
Computer Specs
Moderator with 34,408 posts.
 
Join Date: Oct 2003
Location: Surrey, UK
Experience: Intermediate
07-Feb-2010, 10:03 AM #2
Quote:
-(data is given in the form of a range)
so the entry in the field is text with a > or < sign

is this in excel or access or other program SQL ???

if a spreadsheet - can you upload an example
radhaanand's Avatar
Computer Specs
Junior Member with 3 posts.
 
Join Date: Feb 2010
Experience: Beginner
08-Feb-2010, 02:22 AM #3
-(data is given in the form of a range)
Thanks for your reply.
I am working in an excel spreadsheet.
Please find attached a sample sheet.
The field has a number with a conditional operator prefix.

Regards
Attached Files
File Type: xlsx techguysample.xlsx (8.5 KB, 24 views)
etaf's Avatar
Computer Specs
Moderator with 34,408 posts.
 
Join Date: Oct 2003
Location: Surrey, UK
Experience: Intermediate
08-Feb-2010, 06:17 AM #4
so in your example
grapes 3
would not return a value
and
Apple 4 would also not return a value

correct
radhaanand's Avatar
Computer Specs
Junior Member with 3 posts.
 
Join Date: Feb 2010
Experience: Beginner
08-Feb-2010, 06:48 AM #5
-(data is given in the form of a range)
My apologies for not have given you the complete details

Infact the original data has values for all combinations.

Please find attached the revised sheet.
Regards
Attached Files
File Type: xlsx techguysample.xlsx (8.8 KB, 27 views)
etaf's Avatar
Computer Specs
Moderator with 34,408 posts.
 
Join Date: Oct 2003
Location: Surrey, UK
Experience: Intermediate
08-Feb-2010, 07:39 AM #6
i'm having a little trouble on this, so rather than leave you hanging - I'm very rusty - so an excel guru please step in at any time
I have also moved to business applications - where you should get a lot more response

I can evaluate the greater than using a defined function
So
Code:
Function EVALSTR(strFormula As String)
EVALSTR = Evaluate(strFormula)
End Function
That will do a simple compare on your table- for example
=Evalstr(B10&B2)
and can be used in an IF statement

A function to lookup two values is quite easy
But its doing the evaluating for the 2nd column that I stuck at right now - probably needs to be VBa

if the table had all the values in the 2nd column rather than a >< it would be simple
2 value lookup function..
or index and match -
have a look here
http://www.contextures.com/xlFunctio...ml#IndexMatch4

i will press on,
__________________
Note: I have very limited time during weekdays to visit here, so there will be a delay in replying
UK timezone
Please let us know what the final solution was to any problem posted

Last edited by etaf; 08-Feb-2010 at 08:16 AM..
Reply

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.
Thread Tools



Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 12:08 AM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.