[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Excel Formula Help

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 16
Thread images: 1

File: scorecard2.png (23KB, 709x527px) Image search: [Google]
scorecard2.png
23KB, 709x527px
Trying to set up an excel formula for a scoring card system for my local archery club... Can't figure out how to nest formula IFAND type stuff... Pic for example - Scoring system works on the first of three arrows to hit a scoring zone (A, B or C) and scores go down according to arrow and zone - a formula that was offered to me was, this, but excel says it's invalid and it won't compute...

=IF(AND(B3=1;C3="A");20;IF(AND(B3=1;C3="B");18;IF(AND(B3=1;C3="C");16;IF(AND(B3=2;C3="A");14;IF(AND(B3=2;C3="B");12;IF(AND(B3=2;C3="C");10;IF(AND(B3=3;C3="A");8;IF(AND(B3=3;C3="B");6;IF(AND(B3=1;C3="C");4)))
>>
>>8439053
>using excel

Consider purchasing some tweed and getting knot tying lessons
>>
>>8439065
Cheers - probably not much help with the formula though
>>
>>8439053
Try this formula
=IF(B3=1,IF(C3="A",20,IF(C3="B",18,IF(C3="C",16))),IF(B3=2,IF(C3="A",14,IF(C3="B",12,IF(C3="C",10))),IF(B3=3,IF(C3="A",8,IF(C3="B",6,IF(C3="C",4))))))
>>
>>8439334
Or you could be really fancy and do this
=INDEX($I$3:$I$11,MATCH(B3&C3,$G$3:$G$11&$H$3:$H$11,0))
Be sure to press ctrl+shift+enter after pasting it in to designate it an array formula.

>>8439065
what do you use?
>>
>>8439053
>Excel

>>>/g/tfo
>>
Use VBasic macros, or whatever they're called now.
>>
Maybe you just can't nest it that deep
>>
% run in R where the scores are in a tab-delimited text file with the column headers:
% "target","arrow","zone"
% do not make a score or total column, we'll make that here
% for the "zone" column, code "-" as "-"
% for the "arrow" column, code "-" as 0
options(stringsAsFactors=FALSE)

% set up the key
key <- data.frame(arrow=c(1,1,1,2,2,2,3,3,3,0),zone=c(rep(c("a","b","c"),3),"-"),score=c(20,18,16,14,12,10,8,6,4,0))

% import the scores and add the new columns, initializing all values to zero
scores <- read.delim("scoreTable.txt")
scores$score <- 0
scores$total <- 0

% iterate across the rows
for (eachRow in dim(scores)[1]) {
% set up a boolean to subset the key data frame
keySubset <- (key$arrow == scores$arrow[eachRow]) & (key$zone %in% scores$zone[eachRow])

% get the appropriate current score
currentScore <- key$score[keySubset,]

% add it to the output table
scores$score <- currentScore
if (! eachRow == 1) {
scores$total[eachRow] <- scores$total[eachRow-1] + currentScore
} else {
scores$total[eachRow] <- currentScore
}
}

% write the output table
write.table(scores,"scores.txt",quote=FALSE,row.names=FALSE)
>>
>>8439437
This is awesome but I have no idea what you did there
>>
>>8439450
it's a short R script to read in a file containing the scores, perform the necessary summations, and output a new file
>>
I haven't read the thread so I'm not sure if you have your answer yet, but it seems like you could do this in excel if you change a few variables around. Firstly, replace every A with a 6, every B with a 4 and every C with a 2. Then, replace your arrow numbers like so: 3=>2, 2=>8, 1=>14. Then your score is just the addition of the two rows.
>>
>>8439334
Brilliant! Worked a charm!

Thank you
>>
>>8439053
Why did you separate arrow and zone into separate cells? It seems to me to be simpler to create a single cell and use a vlookup. Lookup Values "1A,1B, 1C, 2A, 2B, 2C, 3A, 3B, 3C".

You can insert a column between H and I with the following formula: =Gn&Hn where is the row number. Then insert between C and D: = Bn&Dn.

Then the formula in D (now column E) = vlookup (Dn, I$3$:J$11$,2)
>>
>>8439661
Using index and match to do lookups is better because the range doesn't have to be in alphabetical/numeric order. Plus you don't need to combine arrow and zone into one. Check out >>8439371 it does the same thing as vlookup, just uses index and match.
>>
OP here - all sorted - thank you for your help
Thread posts: 16
Thread images: 1


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.