Reputation: 23
As an avid player of Team Fortress 2, I decided to start a small side-project where I wanted to create a spreadsheet that would organize and keep current the values of various items on my wishlist of things to eventually buy in-game. However, I'm having a bit of trouble with the IF-ELSE statement to determine how prices are read off. You can see the spreadsheet for yourself at this location, and hopefully you can understand what I'm trying to do with it. Basically, what I want is this:
Here's the problem I'm having with the statement, however, which is as follows:
=IF(SEARCH("bud", $C7), ROUND($B7*$F$5), IF(SEARCH("key", $C7), ROUND($B7*$F$4), ROUND($B7*9)))
What it should do is look for the phrase 'bud' in the currency window; if it can't find that, it should look for 'key' instead anywhere in the phrase; and if it can't find either of those, it defaults to thinking the price is listed as refined metal... except if finding the phrase 'bud' returns false, the whole statement throws back an error instead of trying to instead search for 'key'. Can anyone tell me what I'm doing wrong here and/or how to fix it so that it works?
Upvotes: 2
Views: 78
Reputation: 27282
=if(regexmatch(C6, "(?i)bud"), ROUND($B6*$F$5), if(regexmatch(C6, "(?i)key"), ROUND($B6*$F$4), ROUND($B6*9)))
and drag further down. See if that works ?
Upvotes: 1